aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui
diff options
context:
space:
mode:
authorEsteban MIno <efmino@uc.cl>2018-07-26 08:02:12 +0800
committerEsteban MIno <efmino@uc.cl>2018-07-26 08:02:12 +0800
commitc8d45cb4a8a671bad20cd5a5aa1bcbbd88463bdb (patch)
tree7d1e3d0fd7cbcc0b69ad50d3084ab7ebe7d68202 /old-ui
parent3667f3cb8556d55ad893ec8c1a0f84447273906f (diff)
downloadtangerine-wallet-browser-c8d45cb4a8a671bad20cd5a5aa1bcbbd88463bdb.tar
tangerine-wallet-browser-c8d45cb4a8a671bad20cd5a5aa1bcbbd88463bdb.tar.gz
tangerine-wallet-browser-c8d45cb4a8a671bad20cd5a5aa1bcbbd88463bdb.tar.bz2
tangerine-wallet-browser-c8d45cb4a8a671bad20cd5a5aa1bcbbd88463bdb.tar.lz
tangerine-wallet-browser-c8d45cb4a8a671bad20cd5a5aa1bcbbd88463bdb.tar.xz
tangerine-wallet-browser-c8d45cb4a8a671bad20cd5a5aa1bcbbd88463bdb.tar.zst
tangerine-wallet-browser-c8d45cb4a8a671bad20cd5a5aa1bcbbd88463bdb.zip
only show retry button on earliest pending tx
Diffstat (limited to 'old-ui')
-rw-r--r--old-ui/app/components/transaction-list-item.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/old-ui/app/components/transaction-list-item.js b/old-ui/app/components/transaction-list-item.js
index e9280419a..e12f9cd6a 100644
--- a/old-ui/app/components/transaction-list-item.js
+++ b/old-ui/app/components/transaction-list-item.js
@@ -39,11 +39,17 @@ TransactionListItem.prototype.showRetryButton = function () {
const currentNonce = txParams.nonce
const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce)
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')
+ const currentSubmittedTxs = transactions.filter(tx => tx.status === 'submitted')
const lastSubmittedTxWithCurrentNonce = currentNonceSubmittedTxs[0]
const currentTxIsLatestWithNonce = lastSubmittedTxWithCurrentNonce &&
lastSubmittedTxWithCurrentNonce.id === transaction.id
+ const lastTx = currentSubmittedTxs.reduce((tx1, tx2) => {
+ if (tx1.id < tx2.id) return tx1
+ return tx2
+ })
- return currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000
+ const currentTxIsLatest = lastTx.id === transaction.id
+ return currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000 && currentTxIsLatest
}
TransactionListItem.prototype.render = function () {