Commit 2992a0f2 authored by yann300's avatar yann300

inherit from Plugin Engine

parent c1dc7a4b
...@@ -5,6 +5,7 @@ import { RunTab, makeUdapp } from './app/udapp' ...@@ -5,6 +5,7 @@ import { RunTab, makeUdapp } from './app/udapp'
import PanelsResize from './lib/panels-resize' import PanelsResize from './lib/panels-resize'
import { Engine } from '@remixproject/engine' import { Engine } from '@remixproject/engine'
import { RemixEngine } from './remixEngine'
import { RemixAppManager } from './remixAppManager' import { RemixAppManager } from './remixAppManager'
import { FramingService } from './framingService' import { FramingService } from './framingService'
import { MainView } from './app/panels/main-view' import { MainView } from './app/panels/main-view'
...@@ -231,12 +232,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -231,12 +232,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const appManager = self.appManager const appManager = self.appManager
const pluginLoader = appManager.pluginLoader const pluginLoader = appManager.pluginLoader
const workspace = pluginLoader.get() const workspace = pluginLoader.get()
const engine = new Engine() const engine = new RemixEngine()
engine.setPluginOption = ({ name, kind }) => {
if (kind === 'provider') return { queueTimeout: 60000 * 2 }
if (name === 'LearnEth') return { queueTimeout: 60000 }
return { queueTimeout: 10000 }
}
engine.register(appManager) engine.register(appManager)
// SERVICES // SERVICES
......
...@@ -85,8 +85,8 @@ class PluginManagerComponent extends ViewPlugin { ...@@ -85,8 +85,8 @@ class PluginManagerComponent extends ViewPlugin {
this.filter = '' this.filter = ''
this.appManager.event.on('activate', () => { this.reRender() }) this.appManager.event.on('activate', () => { this.reRender() })
this.appManager.event.on('deactivate', () => { this.reRender() }) this.appManager.event.on('deactivate', () => { this.reRender() })
this.appManager.event.on('added', () => { this.reRender() })
this.engine = engine this.engine = engine
this.engine.event.on('onRegistration', () => { this.reRender() })
} }
isActive (name) { isActive (name) {
......
/* global localStorage, fetch */
import { Engine } from '@remixproject/engine'
import { EventEmitter } from 'events'
export class RemixEngine extends Engine {
constructor () {
super()
this.event = new EventEmitter()
}
setPluginOption ({ name, kind }) {
if (kind === 'provider') return {queueTimeout: 60000 * 2}
if (name === 'LearnEth') return {queueTimeout: 60000}
return {queueTimeout: 10000}
}
onRegistration (plugin) {
this.event.emit('onRegistration', plugin)
}
}
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