sforkowany z mirror/soapbox
Skip dequeue when feed filtering
rodzic
1e53c9f6d4
commit
8c581fc415
|
@ -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();
|
||||||
|
|
|
@ -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));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue