mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix: bind skin loading to the current page and choice
This commit is contained in:
1 parent
15e22d3099
commit
9dfded0fb7
13 files changed
+639
-195
No files matched your search
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user