From 225544e9856cb1416ca277d68c2e68bc3912a07d Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Thu, 24 Jan 2019 18:06:20 +0900 Subject: [PATCH] Reapply the theme first (#3971) * Reapply the theme first * Cannot --- src/client/app/init.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/client/app/init.ts b/src/client/app/init.ts index 5b26f4866d..2f18030f0d 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -387,6 +387,18 @@ export default (callback: (launch: (router: VueRouter) => [Vue, MiOS]) => void, }); //#endregion + // Reapply current theme + try { + const themeName = os.store.state.device.darkmode ? os.store.state.device.darkTheme : os.store.state.device.lightTheme; + const themes = os.store.state.device.themes.concat(builtinThemes); + const theme = themes.find(t => t.id == themeName); + if (theme) { + applyTheme(theme); + } + } catch (e) { + console.log(`Cannot reapply theme. ${e}`); + } + //#region shadow const shadow = '0 3px 8px rgba(0, 0, 0, 0.2)'; const shadowRight = '4px 0 4px rgba(0, 0, 0, 0.1)';