[themes] restore "Dark mode" state after relaunch

This commit is contained in:
Maxim Kadushkin 2021-07-27 16:47:25 +03:00
parent cccc76fbc5
commit eec8783d5b

View file

@ -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;