From bbc764601ec864c2fdbe3ad78c083c5ae80615e0 Mon Sep 17 00:00:00 2001 From: Floyd Li Date: Tue, 10 Jan 2023 14:34:45 +0800 Subject: [PATCH] fix: dark mode toggle if isDark is set to false, it will jump this judgement and use the system prefers if isDark is not set to wsCache it will return null by default --- src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 08d6b99..9a1beeb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -20,7 +20,7 @@ const { wsCache } = useCache() // 根据浏览器当前主题设置系统主题色 const setDefaultTheme = () => { - if (wsCache.get('isDark')) { + if (wsCache.get('isDark') !== null) { appStore.setIsDark(wsCache.get('isDark')) return }