From c3acfe45d225eda1d7c27f5ac19503458e044757 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Thu, 12 Mar 2026 15:58:20 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20fix=20skeleton=20block?= =?UTF-8?q?ed=20on=20main=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If navigating quickly between documents, the skeleton of the document page can be blocked on the main page. This commit fixes this issue by reseting the skeleton state when unmounting the document page. --- src/frontend/apps/impress/src/pages/docs/[id]/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx b/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx index 8210146c..808f14e2 100644 --- a/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx +++ b/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx @@ -157,11 +157,16 @@ const DocPage = ({ id }: DocProps) => { setCurrentDoc(docQuery); }, [docQuery, setCurrentDoc, isFetching]); + /** + * Reset state when unmounting the component to avoid + * showing stale data when navigating to another document + */ useEffect(() => { return () => { setCurrentDoc(undefined); + setIsSkeletonVisible(false); }; - }, [setCurrentDoc]); + }, [setCurrentDoc, setIsSkeletonVisible]); /** * We add a broadcast task to reset the query cache