Merge branch 'scrolltop-fix' into 'main'

Fix ScrollTopButton not loading new posts when scrolled to the top

Closes #871

See merge request soapbox-pub/soapbox!2816
This commit is contained in:
Alex Gleason 2023-10-14 18:34:42 +00:00
commit 374f99405e

View file

@ -44,10 +44,10 @@ const ScrollTopButton: React.FC<IScrollTopButton> = ({
/** Unload feed items if scrolled to the top. */ /** Unload feed items if scrolled to the top. */
const maybeUnload = useCallback(() => { const maybeUnload = useCallback(() => {
if (autoload && scrolledTop) { if (autoload && scrolledTop && count) {
onClick(); onClick();
} }
}, [autoload, scrolledTop, onClick]); }, [autoload, scrolledTop, count, onClick]);
/** Set state while scrolling. */ /** Set state while scrolling. */
const handleScroll = useCallback(throttle(() => { const handleScroll = useCallback(throttle(() => {