Skip to content

Commit

Permalink
fix: modify beforeLoad function (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
RenauxLeaInsee authored Dec 10, 2024
1 parent cfaacda commit 38d8acb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/routes/$survey/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
});

Expand Down
4 changes: 2 additions & 2 deletions src/routes/$survey/repondant/mail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
});

Expand Down

0 comments on commit 38d8acb

Please sign in to comment.