Open accounts and txs in POA explorer

This commit is contained in:
Franco Victorio 2018-07-19 16:23:14 -03:00
parent 2a9f0a3f6a
commit 542b533833
2 changed files with 13 additions and 3 deletions

View File

@ -164,9 +164,13 @@ class AccountDropdowns extends Component {
genPOAEplorerAccountLink (selected, network) {
const isSokol = parseInt(network) === 77
const isPOA = parseInt(network) === 99
if (isSokol) {
return `https://sokol.poaexplorer.com/address/search/${selected}`
}
if (isPOA) {
return `https://poaexplorer.com/address/search/${selected}`
}
return ''
}
@ -176,7 +180,8 @@ class AccountDropdowns extends Component {
const { optionsMenuActive } = this.state
const isSokol = parseInt(network) === 77
const explorerStr = isSokol ? 'POA explorer' : 'Etherscan'
const isPOA = parseInt(network) === 99
const explorerStr = (isSokol || isPOA) ? 'POA explorer' : 'Etherscan'
return h(
Dropdown,
@ -201,7 +206,7 @@ class AccountDropdowns extends Component {
closeMenu: () => {},
onClick: () => {
const { selected, network } = this.props
const url = isSokol ? this.genPOAEplorerAccountLink(selected, network) : genAccountLink(selected, network)
const url = (isSokol || isPOA) ? this.genPOAEplorerAccountLink(selected, network) : genAccountLink(selected, network)
global.platform.openWindow({ url })
},
},

View File

@ -48,9 +48,13 @@ TransactionListItem.prototype.showRetryButton = function () {
const poaExplorerTxLink = (hash, network) => {
const isSokol = network === 77
const isPOA = network === 99
if (isSokol) {
return `https://sokol.poaexplorer.com/txid/search/${hash}`
}
if (isPOA) {
return `https://poaexplorer.com/txid/search/${hash}`
}
return ''
}
@ -89,8 +93,9 @@ TransactionListItem.prototype.render = function () {
event.stopPropagation()
if (!transaction.hash || !isLinkable) return
const isSokol = numericNet === 77
const isPOA = numericNet === 99
let url
if (isSokol) {
if (isSokol || isPOA) {
url = poaExplorerTxLink(transaction.hash, numericNet)
} else {
url = explorerLink(transaction.hash, numericNet)