From db63ebd0c8beee610a9a45906ccd817bd2167def Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Fri, 30 May 2025 12:39:59 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20fix=20meta=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The meta title was flickering, it was adding the doc title, then it was coming back to the default title. This was due to the way the next Head component render data. We now use a more stable way to set the title. --- CHANGELOG.md | 1 + src/frontend/apps/impress/src/pages/_app.tsx | 1 + .../impress/src/pages/docs/[id]/index.tsx | 24 ++++++++++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee9f23c2..3ff873ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to -🐛(frontend) table of content disappearing #982 -🐛(frontend) fix multiple EmojiPicker #1012 +-🐛(frontend) fix meta title #1017 ## [3.3.0] - 2025-05-06 diff --git a/src/frontend/apps/impress/src/pages/_app.tsx b/src/frontend/apps/impress/src/pages/_app.tsx index 2015f7ae..75596c5e 100644 --- a/src/frontend/apps/impress/src/pages/_app.tsx +++ b/src/frontend/apps/impress/src/pages/_app.tsx @@ -26,6 +26,7 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) { <> {t('Docs')} + { useCollaboration(doc?.id, doc?.content); const { t } = useTranslation(); - useEffect(() => { - if (doc?.title) { - setTimeout(() => { - document.title = `${doc.title} - ${t('Docs')}`; - }, 100); - } - }, [doc?.title, t]); - useEffect(() => { if (!docQuery || isFetching) { return; @@ -142,7 +134,21 @@ const DocPage = ({ id }: DocProps) => { ); } - return ; + return ( + <> + + + {doc.title} - {t('Docs')} + + + + + + ); }; const Page: NextPageWithLayout = () => {