Merge pull request #1915 from ethereum/dontConnect_Metamask_atLoad

don't init at pageload but when run tab loads
pull/1/head
yann300 6 years ago committed by GitHub
commit 6629a5add5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/app.js
  2. 30
      src/app/tabs/run-tab.js
  3. 1
      src/universal-dapp.js

@ -129,9 +129,6 @@ class App {
self._components.config = new Config(fileStorage) self._components.config = new Config(fileStorage)
registry.put({api: self._components.config, name: 'config'}) registry.put({api: self._components.config, name: 'config'})
executionContext.init(self._components.config)
executionContext.listenOnLastBlock()
self._components.gistHandler = new GistHandler() self._components.gistHandler = new GistHandler()
self._components.filesProviders = {} self._components.filesProviders = {}

@ -12,6 +12,8 @@ var ContractDropdownUI = require('./runTab/contractDropdown.js')
var Recorder = require('./runTab/model/recorder.js') var Recorder = require('./runTab/model/recorder.js')
var RecorderUI = require('./runTab/recorder.js') var RecorderUI = require('./runTab/recorder.js')
const executionContext = require('../../execution-context')
import { BaseApi } from 'remix-plugin' import { BaseApi } from 'remix-plugin'
const profile = { const profile = {
@ -30,13 +32,15 @@ class RunTab extends BaseApi {
constructor (udapp, udappUI, config, fileManager, editor, logCallback, filePanel, pluginManager, compilersArtefacts) { constructor (udapp, udappUI, config, fileManager, editor, logCallback, filePanel, pluginManager, compilersArtefacts) {
super(profile) super(profile)
this.event = new EventManager() this.event = new EventManager()
this.config = config
this.renderInstanceContainer() this.udapp = udapp
this.renderSettings(udapp) this.udappUI = udappUI
this.renderDropdown(udappUI, fileManager, pluginManager, compilersArtefacts, config, editor, udapp, filePanel, logCallback) this.fileManager = fileManager
this.renderRecorder(udapp, udappUI, fileManager, config, logCallback) this.editor = editor
this.renderRecorderCard() this.logCallback = logCallback
this.renderContainer() this.filePanel = filePanel
this.pluginManager = pluginManager
this.compilersArtefacts = compilersArtefacts
} }
renderContainer () { renderContainer () {
@ -51,6 +55,7 @@ class RunTab extends BaseApi {
</div> </div>
` `
this.container.appendChild(el) this.container.appendChild(el)
return this.container
} }
renderInstanceContainer () { renderInstanceContainer () {
@ -158,7 +163,16 @@ class RunTab extends BaseApi {
} }
render () { render () {
return this.container executionContext.init(this.config)
executionContext.stopListenOnLastBlock()
executionContext.listenOnLastBlock()
this.udapp.resetEnvironment()
this.renderInstanceContainer()
this.renderSettings(this.udapp)
this.renderDropdown(this.udappUI, this.fileManager, this.pluginManager, this.compilersArtefacts, this.config, this.editor, this.udapp, this.filePanel, this.logCallback)
this.renderRecorder(this.udapp, this.udappUI, this.fileManager, this.config, this.logCallback)
this.renderRecorderCard()
return this.renderContainer()
} }
} }

@ -38,7 +38,6 @@ module.exports = class UniversalDApp extends UdappApi {
} }
this.txRunner = new TxRunner({}, this._txRunnerAPI) this.txRunner = new TxRunner({}, this._txRunnerAPI)
this.accounts = {} this.accounts = {}
this.resetEnvironment()
executionContext.event.register('contextChanged', this.resetEnvironment.bind(this)) executionContext.event.register('contextChanged', this.resetEnvironment.bind(this))
} }

Loading…
Cancel
Save