Update remixAppManager.js

pull/1/head
yann300 6 years ago committed by GitHub
parent 45b566945f
commit 9804b7baa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      src/remixAppManager.js

@ -18,35 +18,16 @@ export class RemixAppManager extends AppManagerApi {
return this.data.proxy return this.data.proxy
} }
doActivate (name) { setActive (name, isActive) {
this.activateOne(name)
// temp
this.store.activate(name)
// promise ?
const entity = this.getEntity(name) const entity = this.getEntity(name)
if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { if (entity && entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') {
this.event.emit('requestContainer', entity.profile, entity.api.render()) isActive ? this.event.emit('requestContainer', entity.profile, entity.api.render())
} : this.event.emit('removingItem', entity.profile)
if (name === 'SolidityCompile') {
this.data.proxy.register(entity.api)
} }
}
doDeactivate (name) {
this.deactivateOne(name)
// temp // temp
this.store.deactivate(name) if (entity && name === 'SolidityCompiler') {
// promise ? isActive ? this.data.proxy.register(entity.api) : this.data.proxy.unregister(entity.api)
const entity = this.getEntity(name)
if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') {
this.event.emit('removingItem', entity.profile)
}
if (name === 'SolidityCompile') {
this.data.proxy.unregister(entity.api)
} }
}
setActive (name, isActive) {
isActive ? this.store.activate(name) : this.store.deactivate(name) isActive ? this.store.activate(name) : this.store.deactivate(name)
} }
@ -57,4 +38,4 @@ export class RemixAppManager extends AppManagerApi {
addEntity (entity) { addEntity (entity) {
this.store.add(entity.profile.name, entity) this.store.add(entity.profile.name, entity)
} }
} }

Loading…
Cancel
Save