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 = () => {
if (wsCache.get(CACHE_KEY.IS_DARK)) {
if (wsCache.get(CACHE_KEY.IS_DARK) || wsCache.get(CACHE_KEY.IS_DARK) === 'true') {
appStore.setIsDark(true)
} else {
appStore.setIsDark(false)
}
return
let isDarkTheme = wsCache.get(CACHE_KEY.IS_DARK)
if (isDarkTheme === null) {
isDarkTheme = isDark()
}
const isDarkTheme = isDark()
appStore.setIsDark(isDarkTheme)
}
setDefaultTheme()