Skip dequeue when feed filtering

environments/review-feed-repla-6j3cqg/deployments/424
Justin 2022-06-29 09:12:12 -04:00
rodzic 1e53c9f6d4
commit 8c581fc415
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -52,7 +52,7 @@ const ScrollTopButton: React.FC<IScrollTopButton> = ({
} else {
setScrolled(false);
}
}, 150, { trailing: true }), [autoload, threshold, autoloadThreshold]);
}, 150, { trailing: true }), [autoload, threshold, autoloadThreshold, onClick]);
const scrollUp = () => {
window.scrollTo({ top: 0 });
@ -69,7 +69,7 @@ const ScrollTopButton: React.FC<IScrollTopButton> = ({
return () => {
window.removeEventListener('scroll', handleScroll);
};
}, []);
}, [onClick]);
useEffect(() => {
maybeUnload();

Wyświetl plik

@ -33,8 +33,13 @@ const Timeline: React.FC<ITimeline> = ({
const isPartial = useAppSelector(state => (state.timelines.get(timelineId)?.isPartial || false) === true);
const hasMore = useAppSelector(state => state.timelines.get(timelineId)?.hasMore === true);
const totalQueuedItemsCount = useAppSelector(state => state.timelines.get(timelineId)?.totalQueuedItemsCount || 0);
const isFilteringFeed = useAppSelector(state => !!state.timelines.get(timelineId)?.feedAccountId);
const handleDequeueTimeline = () => {
if (isFilteringFeed) {
return;
}
dispatch(dequeueTimeline(timelineId, onLoadMore));
};