remove ensureDeactivated

pull/5370/head
yann300 4 years ago
parent 528e42bbef
commit 6c40c2a62b
  1. 8
      apps/remix-ide/src/app/files/remixd-handle.js
  2. 7
      apps/remix-ide/src/remixAppManager.js

@ -40,7 +40,7 @@ export class RemixdHandle extends WebsocketPlugin {
deactivate () { deactivate () {
this.fileSystemExplorer.hide() this.fileSystemExplorer.hide()
if (super.socket) super.deactivate() if (super.socket) super.deactivate()
this.appManager.ensureDeactivated('git') this.call('manager', 'deactivatePlugin', 'git')
this.locahostProvider.close((error) => { this.locahostProvider.close((error) => {
if (error) console.log(error) if (error) console.log(error)
}) })
@ -52,8 +52,8 @@ export class RemixdHandle extends WebsocketPlugin {
} }
async canceled () { async canceled () {
this.appManager.ensureDeactivated('remixd') this.call('manager', 'deactivatePlugin', 'remixd')
this.appManager.ensureDeactivated('git') this.call('manager', 'deactivatePlugin', 'git')
} }
/** /**
@ -84,7 +84,7 @@ export class RemixdHandle extends WebsocketPlugin {
} }
}, 3000) }, 3000)
this.locahostProvider.init(_ => this.fileSystemExplorer.ensureRoot()) this.locahostProvider.init(_ => this.fileSystemExplorer.ensureRoot())
this.appManager.ensureActivated('git') this.call('manager', 'activatePlugin', 'git')
} }
} }
if (this.locahostProvider.isConnected()) { if (this.locahostProvider.isConnected()) {

@ -34,7 +34,7 @@ export class RemixAppManager extends PluginManager {
async canDeactivatePlugin (from, to) { async canDeactivatePlugin (from, to) {
if (requiredModules.includes(to.name)) return false if (requiredModules.includes(to.name)) return false
return from.name === 'manager' return isNative(from.name)
} }
async canCall (from, to, method, message) { async canCall (from, to, method, message) {
@ -70,11 +70,6 @@ export class RemixAppManager extends PluginManager {
this.event.emit('deactivate', plugin) this.event.emit('deactivate', plugin)
} }
async ensureDeactivated (apiName) {
await this.deactivatePlugin(apiName)
this.event.emit('ensureDeactivated', apiName)
}
isRequired (name) { isRequired (name) {
return requiredModules.includes(name) return requiredModules.includes(name)
} }

Loading…
Cancel
Save