From 6c40c2a62bdb130f7a756e28f44d20ccb247b78c Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 7 Dec 2020 15:31:22 +0100 Subject: [PATCH] remove ensureDeactivated --- apps/remix-ide/src/app/files/remixd-handle.js | 8 ++++---- apps/remix-ide/src/remixAppManager.js | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/apps/remix-ide/src/app/files/remixd-handle.js b/apps/remix-ide/src/app/files/remixd-handle.js index 2b1050487d..6875040431 100644 --- a/apps/remix-ide/src/app/files/remixd-handle.js +++ b/apps/remix-ide/src/app/files/remixd-handle.js @@ -40,7 +40,7 @@ export class RemixdHandle extends WebsocketPlugin { deactivate () { this.fileSystemExplorer.hide() if (super.socket) super.deactivate() - this.appManager.ensureDeactivated('git') + this.call('manager', 'deactivatePlugin', 'git') this.locahostProvider.close((error) => { if (error) console.log(error) }) @@ -52,8 +52,8 @@ export class RemixdHandle extends WebsocketPlugin { } async canceled () { - this.appManager.ensureDeactivated('remixd') - this.appManager.ensureDeactivated('git') + this.call('manager', 'deactivatePlugin', 'remixd') + this.call('manager', 'deactivatePlugin', 'git') } /** @@ -84,7 +84,7 @@ export class RemixdHandle extends WebsocketPlugin { } }, 3000) this.locahostProvider.init(_ => this.fileSystemExplorer.ensureRoot()) - this.appManager.ensureActivated('git') + this.call('manager', 'activatePlugin', 'git') } } if (this.locahostProvider.isConnected()) { diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index a4536e4724..c6156355a0 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -34,7 +34,7 @@ export class RemixAppManager extends PluginManager { async canDeactivatePlugin (from, to) { if (requiredModules.includes(to.name)) return false - return from.name === 'manager' + return isNative(from.name) } async canCall (from, to, method, message) { @@ -70,11 +70,6 @@ export class RemixAppManager extends PluginManager { this.event.emit('deactivate', plugin) } - async ensureDeactivated (apiName) { - await this.deactivatePlugin(apiName) - this.event.emit('ensureDeactivated', apiName) - } - isRequired (name) { return requiredModules.includes(name) }