fix: 暗黑模式bug

pull/2/head
xingyu 2022-12-07 20:40:37 +08:00
parent 9801195a77
commit a97db2754a
1 changed files with 3 additions and 8 deletions

View File

@ -15,15 +15,10 @@ const { wsCache } = useCache()
// //
const setDefaultTheme = () => { const setDefaultTheme = () => {
if (wsCache.get(CACHE_KEY.IS_DARK)) { let isDarkTheme = wsCache.get(CACHE_KEY.IS_DARK)
if (wsCache.get(CACHE_KEY.IS_DARK) || wsCache.get(CACHE_KEY.IS_DARK) === 'true') { if (isDarkTheme === null) {
appStore.setIsDark(true) isDarkTheme = isDark()
} else {
appStore.setIsDark(false)
}
return
} }
const isDarkTheme = isDark()
appStore.setIsDark(isDarkTheme) appStore.setIsDark(isDarkTheme)
} }
setDefaultTheme() setDefaultTheme()