aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui/app/components
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2018-07-26 10:12:49 +0800
committerGitHub <noreply@github.com>2018-07-26 10:12:49 +0800
commit53b440a2878cea6b97c42e9cc7969eabd3431f27 (patch)
tree810891380f2fea1b96fc6b91bd6c7137986aecfd /old-ui/app/components
parentacddb85f2ec1bd8c005377d098d9597d0eba294a (diff)
parentb580f60d749b862fe08adfc7457c726905ebc623 (diff)
downloadtangerine-wallet-browser-53b440a2878cea6b97c42e9cc7969eabd3431f27.tar.gz
tangerine-wallet-browser-53b440a2878cea6b97c42e9cc7969eabd3431f27.tar.zst
tangerine-wallet-browser-53b440a2878cea6b97c42e9cc7969eabd3431f27.zip
Merge pull request #4885 from MetaMask/RetryOnEarliestPendingTx
Only show retry button on the earliest pending tx
Diffstat (limited to 'old-ui/app/components')
-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 () {