display msg if tx not found

pull/7/head
yann300 8 years ago
parent e7ef7f4fea
commit b2e4b3fa75
  1. 5
      src/ui/DropdownPanel.js
  2. 13
      src/ui/TxBrowser.js

@ -81,4 +81,9 @@ DropdownPanel.prototype.toggle = function () {
} }
} }
DropdownPanel.prototype.hide = function () {
var el = this.view.querySelector('.dropdownpanel')
el.style.display = 'none'
}
module.exports = DropdownPanel module.exports = DropdownPanel

@ -37,6 +37,7 @@ TxBrowser.prototype.setDefaultValues = function () {
this.connectInfo = '' this.connectInfo = ''
this.basicPanel.data = {} this.basicPanel.data = {}
this.basicPanel.update() this.basicPanel.update()
this.basicPanel.hide()
this.updateWeb3Url(util.web3.currentProvider.host) this.updateWeb3Url(util.web3.currentProvider.host)
} }
@ -57,16 +58,16 @@ TxBrowser.prototype.submit = function () {
}) })
} }
} catch (e) { } catch (e) {
console.log(e) self.update(e.message)
} }
} }
TxBrowser.prototype.update = function (error, tx) { TxBrowser.prototype.update = function (error, tx) {
var info = {}
if (error) { if (error) {
console.log(error) console.log(error)
return info[''] = error
} } else {
var info = {}
if (tx) { if (tx) {
if (!tx.to) { if (!tx.to) {
tx.to = traceHelper.contractCreationToken('0') tx.to = traceHelper.contractCreationToken('0')
@ -82,8 +83,12 @@ TxBrowser.prototype.update = function (error, tx) {
info.hash = mes info.hash = mes
console.log('cannot find ' + this.blockNumber + ' ' + this.txNumber) console.log('cannot find ' + this.blockNumber + ' ' + this.txNumber)
} }
}
this.basicPanel.data = info this.basicPanel.data = info
this.basicPanel.update() this.basicPanel.update()
if (error) {
this.basicPanel.toggle()
}
} }
TxBrowser.prototype.updateWeb3Url = function (newhost) { TxBrowser.prototype.updateWeb3Url = function (newhost) {

Loading…
Cancel
Save