From e4beafb11f1ee9dd4f464e7d627e40d58dad2115 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sat, 23 Dec 2023 15:15:14 +0100 Subject: [PATCH] Cancel the navigation state update correctly (#507) The timeout was never canceled in case the tab changed, thus, it kept updating the navigation state for the previous tab and the new tab. --- src/components/MangaGrid.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MangaGrid.tsx b/src/components/MangaGrid.tsx index 524fa26e..354775dd 100644 --- a/src/components/MangaGrid.tsx +++ b/src/components/MangaGrid.tsx @@ -103,7 +103,7 @@ const VerticalGrid = ({ ); }, 250); }; - useEffect(() => clearTimeout(persistGridStateTimeout.current), []); + useEffect(() => clearTimeout(persistGridStateTimeout.current), [location.key, persistGridStateTimeout.current]); return ( <>