From b9046a2d9b1ba7ec3535f7e2ded054cb4b34e765 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Mon, 9 Sep 2024 17:35:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20meta=20title=20rerende?= =?UTF-8?q?r=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The meta title is not displayed when we come back to a page from the dynamic router. The code seems to compute to quickly so we need to add a delay to the meta title computation. --- src/frontend/apps/impress/src/pages/docs/[id]/index.tsx | 4 +++- 1 file changed, 3 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 d81cc776..205a7cbf 100644 --- a/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx +++ b/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx @@ -36,7 +36,9 @@ const DocPage = ({ id }: DocProps) => { useEffect(() => { if (doc?.title) { - document.title = `${doc.title} - Docs`; + setTimeout(() => { + document.title = `${doc.title} - Docs`; + }, 100); } }, [doc?.title]);