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

Make sure the theme exists
fix-lint
Liana Husikyan 4 years ago committed by GitHub
commit f40d57839b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      apps/remix-ide/src/app/tabs/theme-module.js

@ -34,9 +34,12 @@ export class ThemeModule extends Plugin {
config: registry.get('config').api
}
this.themes = themes.reduce((acc, theme) => ({ ...acc, [theme.name]: theme }), {})
const theme = (new QueryParams()).get().theme
this.active = theme || this._deps.config.get('settings/theme') || 'Dark'
this.forced = theme !== undefined
let queryTheme = (new QueryParams()).get().theme
queryTheme = this.themes[queryTheme] ? queryTheme : null
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 */

Loading…
Cancel
Save