From a360e037b59cdcf7039d238e683baecab60f9ce1 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Fri, 28 May 2021 15:12:22 +0300 Subject: [PATCH] [themes] debug --- apps/common/main/lib/controller/Themes.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index 8a246b9895..2148e089e7 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -268,11 +268,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); - var obj = get_current_theme_colors(name_colors); - obj.type = themes_map[id].type; - obj.name = id; + if ( this.api ) { + var obj = get_current_theme_colors(name_colors); + obj.type = themes_map[id].type; + obj.name = id; - this.api.asc_setSkin(obj); + this.api.asc_setSkin(obj); + } Common.localStorage.setItem('ui-theme', id); Common.NotificationCenter.trigger('uitheme:changed', id);