From d8b6227baa4454676e9c11edfa36facb20b8c2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8B=B7=E9=92=89?= <41830859@qq.com> Date: Tue, 4 Jun 2019 14:07:21 +0800 Subject: [PATCH] Update setting.ts --- src/models/setting.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/setting.ts b/src/models/setting.ts index d0d76da7..8e2695bd 100644 --- a/src/models/setting.ts +++ b/src/models/setting.ts @@ -104,7 +104,7 @@ const SettingModel: SettingModelType = { }); const { primaryColor, colorWeak } = setting; - if (state.primaryColor !== primaryColor) { + if (primaryColor && state.primaryColor !== primaryColor) { updateTheme(primaryColor); } updateColorWeak(!!colorWeak); @@ -133,13 +133,13 @@ const SettingModel: SettingModelType = { } }); const { primaryColor, colorWeak, contentWidth } = payload; - if (state.primaryColor !== primaryColor) { + if (primaryColor && state.primaryColor !== primaryColor) { updateTheme(primaryColor); } if (state.contentWidth !== contentWidth && window.dispatchEvent) { window.dispatchEvent(new Event('resize')); } - updateColorWeak(colorWeak); + updateColorWeak(!!colorWeak); window.history.replaceState(null, 'setting', urlParams.href); return { ...state, -- GitLab