From eec8783d5b807f35485fdf64181171ea78b4ce13 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 27 Jul 2021 16:47:25 +0300 Subject: [PATCH] [themes] restore "Dark mode" state after relaunch --- apps/common/main/lib/controller/Themes.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index 92790bab1..c2d0589a0 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -321,6 +321,13 @@ define([ document.body.className = document.body.className.replace(/theme-[\w-]+\s?/gi, '').trim(); document.body.classList.add(id, 'theme-type-' + themes_map[id].type); + if ( themes_map[id].type == 'light' ) { + this.api.asc_setContentDarkMode(false); + } else { + this.api.asc_setContentDarkMode(this.isContentThemeDark()); + Common.NotificationCenter.trigger('contenttheme:dark', this.isContentThemeDark()); + } + if ( this.api ) { var obj = get_current_theme_colors(name_colors); obj.type = themes_map[id].type;