From 38d8acb8f31eafb3c0098bac7741584a4c22b85d Mon Sep 17 00:00:00 2001 From: RenauxLeaInsee <153934662+RenauxLeaInsee@users.noreply.github.com> Date: Tue, 10 Dec 2024 10:56:02 +0100 Subject: [PATCH] fix: modify beforeLoad function (#93) --- src/routes/$survey/login.tsx | 4 ++-- src/routes/$survey/repondant/mail.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/$survey/login.tsx b/src/routes/$survey/login.tsx index bf1450a..262c78a 100644 --- a/src/routes/$survey/login.tsx +++ b/src/routes/$survey/login.tsx @@ -8,10 +8,10 @@ import { useTranslation } from "i18n/i18n"; export const Route = createFileRoute("/$survey/login")({ component: LoginPage, - beforeLoad: async ({ params }) => { + beforeLoad: ({ params }) => { const titleShort = content.specifique.find(survey => survey.id === params.survey)?.titleShort; const theme = document.querySelector("html")?.getAttribute("data-fr-scheme") ?? "system"; - await protectedLoader(theme, titleShort); + protectedLoader(theme, titleShort); }, }); diff --git a/src/routes/$survey/repondant/mail.tsx b/src/routes/$survey/repondant/mail.tsx index 1b4afd6..07bd4e8 100644 --- a/src/routes/$survey/repondant/mail.tsx +++ b/src/routes/$survey/repondant/mail.tsx @@ -7,10 +7,10 @@ import { Helmet } from "react-helmet-async"; export const Route = createFileRoute("/$survey/repondant/mail")({ component: MailPage, - beforeLoad: async ({ params }) => { + beforeLoad: ({ params }) => { const titleShort = content.specifique.find(survey => survey.id === params.survey)?.titleShort; const theme = document.querySelector("html")?.getAttribute("data-fr-scheme") ?? "system"; - await protectedLoader(theme, titleShort); + protectedLoader(theme, titleShort); }, });