From aa66ba54c561ab2a1960edfba20e55328f665db2 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Mon, 7 Apr 2025 13:16:31 +0800 Subject: [PATCH] fix: set proper default theme mode, closes #823 (#824) --- apps/readest-app/src/utils/style.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/readest-app/src/utils/style.ts b/apps/readest-app/src/utils/style.ts index eecb621d..c7c7986b 100644 --- a/apps/readest-app/src/utils/style.ts +++ b/apps/readest-app/src/utils/style.ts @@ -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; }