diff --git a/src/App.svelte b/src/App.svelte index 873c37b40..ecb8e579d 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -2,7 +2,12 @@ import * as router from "@app/lib/router"; import { unreachable } from "@app/lib/utils"; - import { codeFont, followSystemTheme, theme } from "@app/lib/appearance"; + import { + codeFont, + followSystemTheme, + loadTheme, + theme, + } from "@app/lib/appearance"; import FullscreenModalPortal from "./App/FullscreenModalPortal.svelte"; import Hotkeys from "./App/Hotkeys.svelte"; @@ -32,6 +37,11 @@ } }); + // Detect any change to the system theme on first load. + if ($followSystemTheme) { + theme.set(loadTheme()); + } + void router.loadFromLocation(); $: document.documentElement.setAttribute("data-codefont", $codeFont);