From 2959dc5bae74c9986178d1a100b27241ecd1fc9e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 14 Oct 2023 13:18:30 -0500 Subject: [PATCH] Fix ScrollTopButton not loading new posts when scrolled to the top --- src/components/scroll-top-button.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/scroll-top-button.tsx b/src/components/scroll-top-button.tsx index 58d356c2ad..9d60936631 100644 --- a/src/components/scroll-top-button.tsx +++ b/src/components/scroll-top-button.tsx @@ -44,10 +44,10 @@ const ScrollTopButton: React.FC = ({ /** Unload feed items if scrolled to the top. */ const maybeUnload = useCallback(() => { - if (autoload && scrolledTop) { + if (autoload && scrolledTop && count) { onClick(); } - }, [autoload, scrolledTop, onClick]); + }, [autoload, scrolledTop, count, onClick]); /** Set state while scrolling. */ const handleScroll = useCallback(throttle(() => {