diff options
| author | Adam Soltys <[email protected]> | 2024-11-06 23:10:14 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-06 23:10:14 -0800 |
| commit | fef8b840e14cfc935c59fea29957c78ff13d3312 (patch) | |
| tree | 8404c55178528b39268615de182a9b879524d0e3 /src/routes/+layout.svelte | |
| parent | 2543db7ab1874d4e773a03c26946ad179877d443 (diff) | |
| download | coinos-ui-fef8b840e14cfc935c59fea29957c78ff13d3312.tar.gz coinos-ui-fef8b840e14cfc935c59fea29957c78ff13d3312.zip | |
theme cookie
Diffstat (limited to 'src/routes/+layout.svelte')
| -rw-r--r-- | src/routes/+layout.svelte | 9 |
1 files changed, 6 insertions, 3 deletions
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 @@ </svelte:head> {#if !$loading} - <main data-theme={$theme}> + <main data-theme={theme}> <slot /> </main> {/if} |
