From f44f73322ae5e47e3921aa8ef4ba29ea4badd53f Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 18 Feb 2020 13:11:32 +0100 Subject: [PATCH] use out of the box profiles --- src/remixAppManager.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/remixAppManager.js b/src/remixAppManager.js index ef071773bd..ad45ef2c75 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -18,7 +18,6 @@ export class RemixAppManager extends PluginManager { constructor (plugins) { super() this.event = new EventEmitter() - this.registered = {} this.pluginsDirectory = 'https://raw.githubusercontent.com/ethereum/remix-plugins-directory/master/build/metadata.json' this.pluginLoader = new PluginLoader() } @@ -42,13 +41,13 @@ export class RemixAppManager extends PluginManager { } getAll () { - return Object.keys(this.registered).map((p) => { - return this.registered[p] + return Object.keys(this.profiles).map((p) => { + return this.profiles[p] }) } getIds () { - return Object.keys(this.registered) + return Object.keys(this.profiles) } onPluginDeactivated (plugin) { @@ -57,18 +56,16 @@ export class RemixAppManager extends PluginManager { } onRegistration (plugin) { - if (!this.registered) this.registered = {} - this.registered[plugin.name] = plugin this.event.emit('added', plugin.name) } - ensureActivated (apiName) { - if (!this.isActive(apiName)) this.activateOne(apiName) + async ensureActivated (apiName) { + await this.activatePlugin(apiName) this.event.emit('ensureActivated', apiName) } - ensureDeactivated (apiName) { - if (this.isActive(apiName)) this.deactivateOne(apiName) + async ensureDeactivated (apiName) { + await this.deactivatePlugin(apiName) this.event.emit('ensureDeactivated', apiName) }