fix(boards-bar): cancel debounced scroll handler on cleanup

This commit is contained in:
plebeius
2026-03-02 19:36:56 +08:00
parent efd152609d
commit ea0789faa1
+4 -1
View File
@@ -398,7 +398,10 @@ const BoardsBarMobile = ({ subplebbitAddress }: { subplebbitAddress?: string })
window.addEventListener('scroll', debouncedHandleScroll, { passive: true });
return () => window.removeEventListener('scroll', debouncedHandleScroll);
return () => {
window.removeEventListener('scroll', debouncedHandleScroll);
debouncedHandleScroll.cancel();
};
}, []);
return (