Skip dequeue when feed filtering

sw-index-revalidate
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 { } else {
setScrolled(false); setScrolled(false);
} }
}, 150, { trailing: true }), [autoload, threshold, autoloadThreshold]); }, 150, { trailing: true }), [autoload, threshold, autoloadThreshold, onClick]);
const scrollUp = () => { const scrollUp = () => {
window.scrollTo({ top: 0 }); window.scrollTo({ top: 0 });
@ -69,7 +69,7 @@ const ScrollTopButton: React.FC<IScrollTopButton> = ({
return () => { return () => {
window.removeEventListener('scroll', handleScroll); window.removeEventListener('scroll', handleScroll);
}; };
}, []); }, [onClick]);
useEffect(() => { useEffect(() => {
maybeUnload(); 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 isPartial = useAppSelector(state => (state.timelines.get(timelineId)?.isPartial || false) === true);
const hasMore = useAppSelector(state => state.timelines.get(timelineId)?.hasMore === true); const hasMore = useAppSelector(state => state.timelines.get(timelineId)?.hasMore === true);
const totalQueuedItemsCount = useAppSelector(state => state.timelines.get(timelineId)?.totalQueuedItemsCount || 0); const totalQueuedItemsCount = useAppSelector(state => state.timelines.get(timelineId)?.totalQueuedItemsCount || 0);
const isFilteringFeed = useAppSelector(state => !!state.timelines.get(timelineId)?.feedAccountId);
const handleDequeueTimeline = () => { const handleDequeueTimeline = () => {
if (isFilteringFeed) {
return;
}
dispatch(dequeueTimeline(timelineId, onLoadMore)); dispatch(dequeueTimeline(timelineId, onLoadMore));
}; };