From fef8b840e14cfc935c59fea29957c78ff13d3312 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 6 Nov 2024 23:10:14 -0800 Subject: theme cookie --- src/routes/+layout.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/routes/+layout.svelte') diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 78ce0fd9..e5aeb206 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -4,15 +4,18 @@ import "../app.css"; import { loading, t } from "$lib/translations"; import { onMount } from "svelte"; - import { installPrompt, theme } from "$lib/store"; + import { installPrompt, theme as themeStore } from "$lib/store"; export let data; - let { pathname } = data; + let { pathname, theme } = data; + $themeStore = theme; let host = PUBLIC_DOMAIN.includes("localhost") ? `http://${PUBLIC_DOMAIN}` : `https://${PUBLIC_DOMAIN}`; + $: theme = $themeStore + onMount(() => { if (!browser) return; window.addEventListener("beforeinstallprompt", (event) => { @@ -44,7 +47,7 @@ {#if !$loading} -
+
{/if} -- cgit v1.2.3