Unverified Commit f40d5783 authored by Liana Husikyan's avatar Liana Husikyan Committed by GitHub

Merge pull request #444 from ethereum/yann300-patch-7

Make sure the theme exists
parents 6da50fb6 43884a86
...@@ -34,9 +34,12 @@ export class ThemeModule extends Plugin { ...@@ -34,9 +34,12 @@ export class ThemeModule extends Plugin {
config: registry.get('config').api config: registry.get('config').api
} }
this.themes = themes.reduce((acc, theme) => ({ ...acc, [theme.name]: theme }), {}) this.themes = themes.reduce((acc, theme) => ({ ...acc, [theme.name]: theme }), {})
const theme = (new QueryParams()).get().theme let queryTheme = (new QueryParams()).get().theme
this.active = theme || this._deps.config.get('settings/theme') || 'Dark' queryTheme = this.themes[queryTheme] ? queryTheme : null
this.forced = theme !== undefined let currentTheme = this._deps.config.get('settings/theme')
currentTheme = this.themes[currentTheme] ? currentTheme : null
this.active = queryTheme || currentTheme || 'Dark'
this.forced = queryTheme !== undefined
} }
/** Return the active theme */ /** Return the active theme */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment