move provider change event out of tx browser; simplify set default values

pull/3094/head
Iuri Matias 6 years ago committed by yann300
parent bbfb0aa500
commit 076bd377b5
  1. 4
      src/app/debugger/debuggerUI.js
  2. 21
      src/app/debugger/debuggerUI/TxBrowser.js

@ -53,6 +53,10 @@ class DebuggerUI {
self.debugger_ui.unLoad()
})
this.debugger_ui.event.register('providerChanged', this, function (provider) {
txBrowser.setDefaultValues()
})
this.txBrowser = this.debugger_ui.txBrowser
}

@ -53,14 +53,15 @@ function TxBrowser (_parent, opts) {
this.txNumber
this.view
this.web3 = opts.web3
var self = this
_parent.event.register('providerChanged', this, function (provider) {
self.setDefaultValues()
// TODO: looks redudant since setDefaultValues already re-renders
if (self.view) {
yo.update(self.view, self.render())
}
})
this.setDefaultValues()
// var self = this
// _parent.event.register('providerChanged', this, function (provider) {
// self.setDefaultValues()
// // TODO: looks redudant since setDefaultValues already re-renders
// if (self.view) {
// yo.update(self.view, self.render())
// }
// })
}
TxBrowser.prototype.setDefaultValues = function () {
@ -134,10 +135,6 @@ TxBrowser.prototype.load = function (txHash, tx) {
TxBrowser.prototype.unload = function (txHash) {
this.event.trigger('unloadRequested')
this.init()
}
TxBrowser.prototype.init = function (ev) {
this.setDefaultValues()
}

Loading…
Cancel
Save