Skip dequeue when feed filtering
This commit is contained in:
parent
1e53c9f6d4
commit
8c581fc415
2 changed files with 7 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -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));
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue