fix flashbang

This commit is contained in:
pa
2026-01-06 20:46:00 +09:00
committed by Natsumi
parent 8ab3257d39
commit 7e8485a5d3
2 changed files with 6 additions and 5 deletions

View File

@@ -75,8 +75,7 @@ function changeAppThemeStyle(themeMode) {
let themeConfig = THEME_CONFIG[themeMode];
if (!themeConfig) {
console.error('Invalid theme mode:', themeMode);
// load system theme as fallback
themeMode = systemIsDarkMode() ? 'dark' : 'light';
themeMode = 'dark';
themeConfig = THEME_CONFIG[themeMode];
const appSettingsStore = useAppearanceSettingsStore();
appSettingsStore.setThemeMode(themeMode);

View File

@@ -286,9 +286,11 @@ export const useAppearanceSettingsStore = defineStore(
);
function normalizeThemeMode(mode) {
return Object.prototype.hasOwnProperty.call(THEME_CONFIG, mode)
? mode
: 'light';
if (Object.prototype.hasOwnProperty.call(THEME_CONFIG, mode)) {
return mode;
} else {
return 'dark';
}
}
/**