mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Make infinite scroll fetch earlier
This commit is contained in:
parent
bab97fba5f
commit
83877d8dab
@ -67,7 +67,8 @@ const InfiniteScroll = <Props,>({
|
|||||||
const offset =
|
const offset =
|
||||||
layout.layout === "horizontal" ? ref.current.offsetWidth : ref.current.offsetHeight;
|
layout.layout === "horizontal" ? ref.current.offsetWidth : ref.current.offsetHeight;
|
||||||
|
|
||||||
if (scroll <= offset * 1.2) loadMore();
|
// Load more if less than 3 element's worth of scroll is left
|
||||||
|
if (scroll <= offset * 3) loadMore();
|
||||||
}, [hasMore, isFetching, layout, loadMore, fetchMore]);
|
}, [hasMore, isFetching, layout, loadMore, fetchMore]);
|
||||||
const scrollProps = { ref, onScroll };
|
const scrollProps = { ref, onScroll };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user