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