1
0
Fork 0

Don't need nearReachEnd, use InView more

This commit is contained in:
Lim Chee Aun 2024-01-02 12:24:03 +08:00
parent cf52e0776e
commit 0ebbc5b34e

View file

@ -239,9 +239,10 @@ function Timeline({
setNearReachStart(nearReachStart); setNearReachStart(nearReachStart);
if (reachStart) { if (reachStart) {
loadItems(true); loadItems(true);
} else if (nearReachEnd || (reachEnd && showMore)) {
loadItems();
} }
// else if (nearReachEnd || (reachEnd && showMore)) {
// loadItems();
// }
}, },
[], [],
); );
@ -451,6 +452,8 @@ function Timeline({
{uiState === 'default' && {uiState === 'default' &&
(showMore ? ( (showMore ? (
<InView <InView
root={scrollableRef.current}
rootMargin={Math.max(screen.width, screen.height) + 'px'}
onChange={(inView) => { onChange={(inView) => {
if (inView) { if (inView) {
loadItems(); loadItems();