Skip to content

Commit 93e7bde

Browse files
chore: Minor adjustment to test versioning
1 parent 6f9edd7 commit 93e7bde

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

svelte-themes/src/lib/theme-provider.svelte

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script lang="ts">
2-
import { onMount, type Snippet } from 'svelte';
2+
import { type Snippet } from 'svelte';
33
import HeadScript from './head-script.svelte';
44
import { Theme } from './theme.svelte.js';
55
import type { Config } from './config.js';
6-
import { hasTheme } from './index.js';
6+
import { hasTheme, HydrationWatcher } from './index.js';
77
import { setTheme } from './context.js';
88
import { run } from 'svelte/legacy';
99
@@ -58,10 +58,7 @@
5858
setTheme(theme);
5959
}
6060
61-
let hydrated = $state(false);
62-
onMount(() => {
63-
hydrated = true;
64-
});
61+
const watcher = new HydrationWatcher();
6562
6663
run(() => {
6764
if (enableSystem && !themes.includes('system')) {
@@ -87,7 +84,7 @@
8784
});
8885
</script>
8986

90-
{#if !hydrated}
87+
{#if !watcher.hydrated}
9188
<HeadScript
9289
{attribute}
9390
{storageKey}

0 commit comments

Comments
 (0)