diff --git a/apps/remix-ide/src/app/components/plugin-manager-component.js b/apps/remix-ide/src/app/components/plugin-manager-component.js index e3d519b55a..14494138a1 100644 --- a/apps/remix-ide/src/app/components/plugin-manager-component.js +++ b/apps/remix-ide/src/app/components/plugin-manager-component.js @@ -108,7 +108,7 @@ class PluginManagerComponent extends ViewPlugin { } deactivateP (name) { - this.appManager.deactivatePlugin(name) + this.call('manager', 'deactivatePlugin', name) _paq.push(['trackEvent', 'manager', 'deactivate', name]) } diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index 179a37065c..24edfa1da6 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -128,7 +128,7 @@ export class TabProxy extends Plugin { () => this.event.emit('switchApp', name), () => { this.event.emit('closeApp', name) - this.appManager.deactivatePlugin(name) + this.call('manager', 'deactivatePlugin', name) }, icon ) diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 610260f59b..4947c3b68d 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -52,6 +52,16 @@ export class RemixAppManager extends PluginManager { return isNative(from.name) } + async deactivatePlugin (name) { + const [to, from] = [ + await this.getProfile(name), + await this.getProfile(this.requestFrom) + ] + if (this.canDeactivatePlugin(from, to)) { + await this.toggleActive(name) + } + } + async canCall (from, to, method, message) { // Make sure the caller of this methods is the target plugin if (to !== this.currentRequest.from) {