From 0ff0a9c1976d726cb18379e3ac06a8677c928659 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Tue, 31 Jul 2018 16:02:29 -0230 Subject: Show the retry button on latest tx of earliest nonce. --- old-ui/app/components/transaction-list-item.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'old-ui/app/components/transaction-list-item.js') diff --git a/old-ui/app/components/transaction-list-item.js b/old-ui/app/components/transaction-list-item.js index f479ce666..015ef6ba6 100644 --- a/old-ui/app/components/transaction-list-item.js +++ b/old-ui/app/components/transaction-list-item.js @@ -36,7 +36,7 @@ TransactionListItem.prototype.showRetryButton = function () { return false } - let currentTxIsLatest = false + let currentTxSharesEarliestNonce = false const currentNonce = txParams.nonce const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce) const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted') @@ -45,14 +45,14 @@ TransactionListItem.prototype.showRetryButton = function () { const currentTxIsLatestWithNonce = lastSubmittedTxWithCurrentNonce && lastSubmittedTxWithCurrentNonce.id === transaction.id if (currentSubmittedTxs.length > 0) { - const lastTx = currentSubmittedTxs.reduce((tx1, tx2) => { + const earliestSubmitted = currentSubmittedTxs.reduce((tx1, tx2) => { if (tx1.submittedTime < tx2.submittedTime) return tx1 return tx2 }) - currentTxIsLatest = lastTx.id === transaction.id + currentTxSharesEarliestNonce = currentNonce === earliestSubmitted.txParams.nonce } - return currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000 && currentTxIsLatest + return currentTxSharesEarliestNonce && currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000 } TransactionListItem.prototype.render = function () { -- cgit