From 5001547386deff98b0b96a3d2a45c0d7ec822362 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 26 May 2016 14:59:05 -0700 Subject: Remove etherscan links from non standard blockchains --- ui/app/components/transaction-list-item.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'ui/app/components/transaction-list-item.js') diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 22f0ce1e3..beff93272 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -23,6 +23,13 @@ TransactionListItem.prototype.render = function() { var date = formatDate(transaction.time) + let isLinkable = false + try { + const numericNet = parseInt(network) + isLinkable = numericNet === 1 || numericNet === 2 + } + catch() {} + var isMsg = ('msgParams' in transaction) var isTx = ('txParams' in transaction) var isPending = transaction.status === 'unconfirmed' @@ -34,7 +41,7 @@ TransactionListItem.prototype.render = function() { txParams = transaction.msgParams } - const isClickable = ('hash' in transaction) || isPending + const isClickable = ('hash' in transaction && isLinkable) || isPending return ( h(`.transaction-list-item.flex-row.flex-space-between${isClickable ? '.pointer' : ''}`, { @@ -44,7 +51,7 @@ TransactionListItem.prototype.render = function() { this.props.showTx(transaction.id) } - if (!transaction.hash) return + if (!transaction.hash || !isLinkable) return var url = explorerLink(transaction.hash, parseInt(network)) chrome.tabs.create({ url }) }, -- cgit v1.2.3