fix: apply theme on init

This commit is contained in:
Roman committed 2020-06-22 16:15:14 +03:00
1 parent 29197dcfb9
commit b4947999df
3 files changed
+27 -14

No files matched your search

+4 -1
View File
@@ -141,7 +141,9 @@ export class ThemeStore {
});
// auto-apply colors to dom from active theme
reaction(() => this.activeTheme, this.onChange);
reaction(() => this.activeTheme, this.onChange, {
fireImmediately: true,
});
// apply theme from configuration
import("./config.store").then(({ configStore }) => {
@@ -184,6 +186,7 @@ export class ThemeStore {
try {
await this.load(themeId);
this.activeThemeId = themeId;
console.log('THEME', themeId, this.themes.get(themeId))
} catch (err) {
if (themeId !== this.defaultTheme.name) {
this.setTheme(); // fallback to default theme