fix: mount ModeWatcher and Toaster at the root layout
The reader and login pages use +layout@ breakouts to escape the (root) shell, so anything mounted in (root)/+layout.svelte never reaches them. ModeWatcher was mounted there and duplicated in login/+layout@.svelte, which left the reader's theme toggle inert: it flipped the store but nothing wrote .dark onto <html>. Mount both once at the top-level +layout.svelte instead, which every route inherits regardless of breakouts.
This commit is contained in:
@@ -11,9 +11,7 @@
|
||||
import { setThemeState } from '$lib/theme/theme.svelte';
|
||||
import type { ThemeConfig } from '$lib/theme/presets';
|
||||
|
||||
import { ModeWatcher } from 'mode-watcher';
|
||||
import { untrack, type Snippet } from 'svelte';
|
||||
import { Toaster } from 'svelte-sonner';
|
||||
|
||||
let {
|
||||
data,
|
||||
@@ -40,8 +38,6 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<Toaster />
|
||||
<ModeWatcher />
|
||||
|
||||
<div class="[--header-height:calc(--spacing(14))]">
|
||||
<Sidebar.Provider class="flex flex-col">
|
||||
|
||||
Reference in New Issue
Block a user