diff --git a/src/remixAppManager.js b/src/remixAppManager.js index 1aef51bdf5..0d91fa36b2 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -240,6 +240,7 @@ class PluginLoader { get currentLoader () { return this.loaders[this.current] } + constructor () { const queryParams = new QueryParams() this.donotAutoReload = ['remixd'] // that would be a bad practice to force loading some plugins at page load. @@ -250,15 +251,13 @@ class PluginLoader { localStorage.setItem('workspace', JSON.stringify(actives)) } }, - get: () => { - return JSON.parse(localStorage.getItem('workspace')) - } + get: () => { return JSON.parse(localStorage.getItem('workspace')) } } this.loaders['queryParams'] = { set: () => {}, get: () => { - let plugins = queryParams.get()['plugins'] + const { plugins } = queryParams.get() if (!plugins) return [] return plugins.split(',') } @@ -268,10 +267,10 @@ class PluginLoader { } set (plugin, actives) { - this.currentLoader().set(plugin, actives) + this.currentLoader.set(plugin, actives) } get () { - return this.currentLoader().get() + return this.currentLoader.get() } } diff --git a/test-browser/tests/workspace.js b/test-browser/tests/workspace.js index e019f4392b..bf5069c5b5 100644 --- a/test-browser/tests/workspace.js +++ b/test-browser/tests/workspace.js @@ -1,6 +1,6 @@ 'use strict' -var init = require('../helpers/init') -var sauce = require('./sauce') +const init = require('../helpers/init') +const sauce = require('./sauce') module.exports = { before: function (browser, done) {