fix: bind skin loading to the current page and choice

This commit is contained in:
illusia committed 2026-10-01 17:00:05 +08:00
1 parent 15e22d3099
commit 9dfded0fb7
13 files changed
+639 -195

No files matched your search

+3 -1
View File
@@ -19,7 +19,9 @@ export function getBuiltinSkinCss(theme: Exclude<ThemeMode, "system">): string {
}
export function getStoredTheme(): ThemeMode {
const value = typeof localStorage === "undefined" ? "" : localStorage.getItem(THEME_KEY);
let value: string | null = null;
try { value = typeof localStorage === "undefined" ? null : localStorage.getItem(THEME_KEY); }
catch { /* A restricted browser still has a usable system theme. */ }
return value === "light" || value === "dark" || value === "system" ? value : "system";
}