no storage theme fallback

pull/2113/head
filip mertens 3 years ago
parent a08a7ff0ef
commit b94b2cdc7d
  1. 4
      apps/remix-ide/src/app/tabs/theme-module.js
  2. 8
      apps/remix-ide/src/index.tsx
  3. 2
      package.json

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

@ -9,15 +9,14 @@ import Registry from './app/state/registry'
import { Storage } from '@remix-project/remix-lib'
(async function() {
// load current theme befor anything else
try {
const configStorage = new Storage('config-v0.8:')
const config = new Config(configStorage)
const config = new Config(configStorage);
Registry.getInstance().put({ api: config, name: 'config' })
} catch (e) {}
const theme = new ThemeModule()
theme.initTheme()
} catch (e) { }
render(
<React.StrictMode>
@ -25,7 +24,4 @@ import { Storage } from '@remix-project/remix-lib'
</React.StrictMode>,
document.getElementById('root')
)
})()

@ -161,7 +161,6 @@
"async": "^2.6.2",
"axios": ">=0.21.1",
"brace": "^0.8.0",
"browserfs": "^1.4.3",
"change-case": "^4.1.1",
"chokidar": "^2.1.8",
"color-support": "^1.1.3",
@ -187,7 +186,6 @@
"merge": "^2.1.1",
"monaco-editor": "^0.30.1",
"npm-install-version": "^6.0.2",
"object-hash": "^3.0.0",
"react": "^17.0.2",
"react-beautiful-dnd": "^13.1.0",
"react-bootstrap": "^1.6.4",

Loading…
Cancel
Save