aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui/app/components/transaction-list-item.js
diff options
context:
space:
mode:
authorEsteban MiƱo <efmino@uc.cl>2018-07-28 04:07:08 +0800
committerGitHub <noreply@github.com>2018-07-28 04:07:08 +0800
commit228f48c6e5423cbf8cfd5d48a3f6f106448cc22e (patch)
tree19a1aa5a5d8ebe349c4807d247f6e317d2ea0852 /old-ui/app/components/transaction-list-item.js
parent5b9725d1f154e8ed0994c3aab844f696937b0e6e (diff)
parent1540b5e256634dbbbc01627ca45afe82329d39a9 (diff)
downloadtangerine-wallet-browser-228f48c6e5423cbf8cfd5d48a3f6f106448cc22e.tar.gz
tangerine-wallet-browser-228f48c6e5423cbf8cfd5d48a3f6f106448cc22e.tar.zst
tangerine-wallet-browser-228f48c6e5423cbf8cfd5d48a3f6f106448cc22e.zip
Merge branch 'develop' into TokensPerAccountBasis
Diffstat (limited to 'old-ui/app/components/transaction-list-item.js')
-rw-r--r--old-ui/app/components/transaction-list-item.js11
1 files changed, 10 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..f479ce666 100644
--- a/old-ui/app/components/transaction-list-item.js
+++ b/old-ui/app/components/transaction-list-item.js
@@ -36,14 +36,23 @@ TransactionListItem.prototype.showRetryButton = function () {
return false
}
+ let currentTxIsLatest = false
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
+ if (currentSubmittedTxs.length > 0) {
+ const lastTx = currentSubmittedTxs.reduce((tx1, tx2) => {
+ if (tx1.submittedTime < tx2.submittedTime) return tx1
+ return tx2
+ })
+ currentTxIsLatest = lastTx.id === transaction.id
+ }
- return currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000
+ return currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000 && currentTxIsLatest
}
TransactionListItem.prototype.render = function () {