Skip to content

Commit

Permalink
sveltekit: remove theme cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
while1618 committed Dec 29, 2024
1 parent e3f1d3e commit 3eb1316
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions frontend/svelte-kit/src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,4 @@ const checkProtectedRoutes: Handle = async ({ event, resolve }) => {
return await resolve(event);
};

const applyTheme: Handle = async ({ event, resolve }) => {
const theme = event.cookies.get('theme');
return await resolve(event, {
transformPageChunk: ({ html }) => html.replace('data-theme=""', `data-theme="${theme}"`),
});
};

export const handle = sequence(
i18n.handle(),
tryToGetSignedInUser,
checkProtectedRoutes,
applyTheme,
);
export const handle = sequence(i18n.handle(), tryToGetSignedInUser, checkProtectedRoutes);

0 comments on commit 3eb1316

Please sign in to comment.