aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-14 08:02:22 +0800
committerDan <danjm.com@gmail.com>2018-03-14 08:02:22 +0800
commit8c7988978f05fa57bba892efb42ae0036ce25771 (patch)
treecaf2fa09c6a14c005e24f1ce1076eca277dbbccd
parente293b6349c522171db26c57e718c5213aa6d5cb3 (diff)
downloadtangerine-wallet-browser-8c7988978f05fa57bba892efb42ae0036ce25771.tar
tangerine-wallet-browser-8c7988978f05fa57bba892efb42ae0036ce25771.tar.gz
tangerine-wallet-browser-8c7988978f05fa57bba892efb42ae0036ce25771.tar.bz2
tangerine-wallet-browser-8c7988978f05fa57bba892efb42ae0036ce25771.tar.lz
tangerine-wallet-browser-8c7988978f05fa57bba892efb42ae0036ce25771.tar.xz
tangerine-wallet-browser-8c7988978f05fa57bba892efb42ae0036ce25771.tar.zst
tangerine-wallet-browser-8c7988978f05fa57bba892efb42ae0036ce25771.zip
Undefined check in showRetryButton
-rw-r--r--old-ui/app/components/transaction-list-item.js7
-rw-r--r--ui/app/components/tx-list-item.js7
2 files changed, 8 insertions, 6 deletions
diff --git a/old-ui/app/components/transaction-list-item.js b/old-ui/app/components/transaction-list-item.js
index b9da171ba..3881d8c1c 100644
--- a/old-ui/app/components/transaction-list-item.js
+++ b/old-ui/app/components/transaction-list-item.js
@@ -34,10 +34,11 @@ 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 isLastSubmittedTxWithCurrentNonce =
- currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1].id === transaction.id
+ const lastSubmittedTxWithCurrentNonce = currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1]
+ const currentTxIsLatestWithNonce = lastSubmittedTxWithCurrentNonce
+ && lastSubmittedTxWithCurrentNonce.id === transaction.id
- return isLastSubmittedTxWithCurrentNonce && Date.now() - submittedTime > 30000
+ return currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000
}
TransactionListItem.prototype.render = function () {
diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js
index d2fc57b13..453f7e95c 100644
--- a/ui/app/components/tx-list-item.js
+++ b/ui/app/components/tx-list-item.js
@@ -186,10 +186,11 @@ TxListItem.prototype.showRetryButton = function () {
const currentNonce = txParams.nonce
const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce)
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => transactionStatus === 'submitted')
- const isLastSubmittedTxWithCurrentNonce =
- currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1].id === transactionId
+ const lastSubmittedTxWithCurrentNonce = currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1]
+ const currentTxIsLatestWithNonce = lastSubmittedTxWithCurrentNonce
+ && lastSubmittedTxWithCurrentNonce.id === transactionId
- return isLastSubmittedTxWithCurrentNonce && Date.now() - transactionSubmittedTime > 30000
+ return currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000
}
TxListItem.prototype.resubmit = function () {