From 8d822ddbeba03b3a92285eccc6acf1cc6da26892 Mon Sep 17 00:00:00 2001 From: JimQing Date: Thu, 3 Sep 2020 20:42:02 +0800 Subject: [PATCH] feature: night mode storage --- src/store/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index bfc98f9..fca12a4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -62,6 +62,7 @@ const mutations = { }, themeChanged(state) { state.nightMode = !state.nightMode; + localStorage.setItem('nightMode', state.nightMode) }, initEditorState(state) { state.currentFont = localStorage.getItem('fonts') || config.builtinFonts[0].value @@ -69,6 +70,7 @@ const mutations = { state.currentSize = localStorage.getItem('size') || config.sizeOption[2].value state.codeTheme = localStorage.getItem('codeTheme') || config.codeThemeOption[0].value state.citeStatus = localStorage.getItem('citeStatus') === 'true' + state.nightMode = localStorage.getItem('nightMode') || false state.wxRenderer = new WxRenderer({ theme: setColor(state.currentColor), fonts: state.currentFont,