diff options
author | Dan <danjm.com@gmail.com> | 2018-03-14 07:39:04 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-03-14 07:45:35 +0800 |
commit | d6e4d2e80d05f64bb543e524c6288b8b7c33e4c1 (patch) | |
tree | 8d352cc48bdccc3173e33f220fdafcd9f88d1320 /old-ui/app/components/transaction-list-item.js | |
parent | 9d7640996aa9b63fb6c9271d7e0698e7acdc559e (diff) | |
download | tangerine-wallet-browser-d6e4d2e80d05f64bb543e524c6288b8b7c33e4c1.tar.gz tangerine-wallet-browser-d6e4d2e80d05f64bb543e524c6288b8b7c33e4c1.tar.zst tangerine-wallet-browser-d6e4d2e80d05f64bb543e524c6288b8b7c33e4c1.zip |
Use new submittedTime field to correctly show retry button in old and new ui.
Diffstat (limited to 'old-ui/app/components/transaction-list-item.js')
-rw-r--r-- | old-ui/app/components/transaction-list-item.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/old-ui/app/components/transaction-list-item.js b/old-ui/app/components/transaction-list-item.js index e7251df8d..b9da171ba 100644 --- a/old-ui/app/components/transaction-list-item.js +++ b/old-ui/app/components/transaction-list-item.js @@ -29,9 +29,15 @@ function TransactionListItem () { } TransactionListItem.prototype.showRetryButton = function () { - const { transaction = {} } = this.props - const { status, time } = transaction - return status === 'submitted' && Date.now() - time > 30000 + const { transaction = {}, transactions } = this.props + const { status, submittedTime, txParams } = transaction + const currentNonce = txParams.nonce + const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce) + const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted') + const isLastSubmittedTxWithCurrentNonce = + currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1].id === transaction.id + + return isLastSubmittedTxWithCurrentNonce && Date.now() - submittedTime > 30000 } TransactionListItem.prototype.render = function () { |