fix: set proper default theme mode, closes #823 (#824)

This commit is contained in:
Huang Xin
2025-04-07 13:16:31 +08:00
committed by GitHub
parent 4f0ef01a17
commit aa66ba54c5
+1 -2
View File
@@ -8,7 +8,6 @@ import { ViewSettings } from '@/types/book';
import {
themes,
Palette,
ThemeMode,
CustomTheme,
generateLightPalette,
generateDarkPalette,
@@ -312,7 +311,7 @@ export const getThemeCode = () => {
let customThemes: CustomTheme[] = [];
if (typeof window !== 'undefined') {
themeColor = localStorage.getItem('themeColor') || 'default';
themeMode = localStorage.getItem('themeMode') as ThemeMode;
themeMode = localStorage.getItem('themeMode') || 'auto';
customThemes = JSON.parse(localStorage.getItem('customThemes') || '[]');
systemIsDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
}