Added threshold for next page calculation

This commit is contained in:
Ivelin Megdanov 2025-03-25 12:25:05 +02:00
parent 12c75d2d11
commit 7389e7b4d0

View file

@ -30,7 +30,7 @@ const Discover = ({ urlParams, queryParams }) => {
if (hasNextPage && metasContainerRef.current) {
const containerHeight = metasContainerRef.current.scrollHeight;
const viewportHeight = metasContainerRef.current.clientHeight;
if (containerHeight <= viewportHeight) {
if (containerHeight <= viewportHeight + SCROLL_TO_BOTTOM_TRESHOLD) {
loadNextPage();
}
}