Unverified Commit 2446e23c authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #1110 from ethereum/fixmanagerdeact

Fixmanagerdeact
parents ac18b5dd bd27e288
...@@ -108,7 +108,7 @@ class PluginManagerComponent extends ViewPlugin { ...@@ -108,7 +108,7 @@ class PluginManagerComponent extends ViewPlugin {
} }
deactivateP (name) { deactivateP (name) {
this.appManager.deactivatePlugin(name) this.call('manager', 'deactivatePlugin', name)
_paq.push(['trackEvent', 'manager', 'deactivate', name]) _paq.push(['trackEvent', 'manager', 'deactivate', name])
} }
......
...@@ -128,7 +128,7 @@ export class TabProxy extends Plugin { ...@@ -128,7 +128,7 @@ export class TabProxy extends Plugin {
() => this.event.emit('switchApp', name), () => this.event.emit('switchApp', name),
() => { () => {
this.event.emit('closeApp', name) this.event.emit('closeApp', name)
this.appManager.deactivatePlugin(name) this.call('manager', 'deactivatePlugin', name)
}, },
icon icon
) )
......
...@@ -52,6 +52,16 @@ export class RemixAppManager extends PluginManager { ...@@ -52,6 +52,16 @@ export class RemixAppManager extends PluginManager {
return isNative(from.name) 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) { async canCall (from, to, method, message) {
// Make sure the caller of this methods is the target plugin // Make sure the caller of this methods is the target plugin
if (to !== this.currentRequest.from) { if (to !== this.currentRequest.from) {
......
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