Commit f44f7332 authored by yann300's avatar yann300 Committed by LianaHus

use out of the box profiles

parent b13a97ef
...@@ -18,7 +18,6 @@ export class RemixAppManager extends PluginManager { ...@@ -18,7 +18,6 @@ export class RemixAppManager extends PluginManager {
constructor (plugins) { constructor (plugins) {
super() super()
this.event = new EventEmitter() this.event = new EventEmitter()
this.registered = {}
this.pluginsDirectory = 'https://raw.githubusercontent.com/ethereum/remix-plugins-directory/master/build/metadata.json' this.pluginsDirectory = 'https://raw.githubusercontent.com/ethereum/remix-plugins-directory/master/build/metadata.json'
this.pluginLoader = new PluginLoader() this.pluginLoader = new PluginLoader()
} }
...@@ -42,13 +41,13 @@ export class RemixAppManager extends PluginManager { ...@@ -42,13 +41,13 @@ export class RemixAppManager extends PluginManager {
} }
getAll () { getAll () {
return Object.keys(this.registered).map((p) => { return Object.keys(this.profiles).map((p) => {
return this.registered[p] return this.profiles[p]
}) })
} }
getIds () { getIds () {
return Object.keys(this.registered) return Object.keys(this.profiles)
} }
onPluginDeactivated (plugin) { onPluginDeactivated (plugin) {
...@@ -57,18 +56,16 @@ export class RemixAppManager extends PluginManager { ...@@ -57,18 +56,16 @@ export class RemixAppManager extends PluginManager {
} }
onRegistration (plugin) { onRegistration (plugin) {
if (!this.registered) this.registered = {}
this.registered[plugin.name] = plugin
this.event.emit('added', plugin.name) this.event.emit('added', plugin.name)
} }
ensureActivated (apiName) { async ensureActivated (apiName) {
if (!this.isActive(apiName)) this.activateOne(apiName) await this.activatePlugin(apiName)
this.event.emit('ensureActivated', apiName) this.event.emit('ensureActivated', apiName)
} }
ensureDeactivated (apiName) { async ensureDeactivated (apiName) {
if (this.isActive(apiName)) this.deactivateOne(apiName) await this.deactivatePlugin(apiName)
this.event.emit('ensureDeactivated', apiName) this.event.emit('ensureDeactivated', apiName)
} }
......
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