|
|
@ -31,7 +31,7 @@ export class ThemeModule extends Plugin { |
|
|
|
super(profile) |
|
|
|
super(profile) |
|
|
|
this.events = new EventEmitter() |
|
|
|
this.events = new EventEmitter() |
|
|
|
this._deps = { |
|
|
|
this._deps = { |
|
|
|
config: Registry.getInstance().get('config').api |
|
|
|
config: Registry.getInstance().get('config') && Registry.getInstance().get('config').api |
|
|
|
} |
|
|
|
} |
|
|
|
this.themes = {} |
|
|
|
this.themes = {} |
|
|
|
themes.map((theme) => { |
|
|
|
themes.map((theme) => { |
|
|
@ -44,7 +44,7 @@ export class ThemeModule extends Plugin { |
|
|
|
let queryTheme = (new QueryParams()).get().theme |
|
|
|
let queryTheme = (new QueryParams()).get().theme |
|
|
|
queryTheme = queryTheme && queryTheme.toLocaleLowerCase() |
|
|
|
queryTheme = queryTheme && queryTheme.toLocaleLowerCase() |
|
|
|
queryTheme = this.themes[queryTheme] ? queryTheme : null |
|
|
|
queryTheme = this.themes[queryTheme] ? queryTheme : null |
|
|
|
let currentTheme = this._deps.config.get('settings/theme') |
|
|
|
let currentTheme = (this._deps.config && this._deps.config.get('settings/theme')) || null |
|
|
|
currentTheme = currentTheme && currentTheme.toLocaleLowerCase() |
|
|
|
currentTheme = currentTheme && currentTheme.toLocaleLowerCase() |
|
|
|
currentTheme = this.themes[currentTheme] ? currentTheme : null |
|
|
|
currentTheme = this.themes[currentTheme] ? currentTheme : null |
|
|
|
this.currentThemeState = { queryTheme, currentTheme } |
|
|
|
this.currentThemeState = { queryTheme, currentTheme } |
|
|
|