From 6e5622a3b99f2bfa74eaed91ce75bc1e5ea616ae Mon Sep 17 00:00:00 2001 From: filip mertens Date: Tue, 13 Apr 2021 11:23:39 +0200 Subject: [PATCH] fix for not deactivating rm console --- .../src/app/components/plugin-manager-component.js | 2 +- apps/remix-ide/src/app/panels/tab-proxy.js | 2 +- apps/remix-ide/src/remixAppManager.js | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) 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) {