Undefined check in showRetryButton

feature/default_network_editable
Dan 7 years ago
parent e293b6349c
commit 8c7988978f
  1. 7
      old-ui/app/components/transaction-list-item.js
  2. 7
      ui/app/components/tx-list-item.js

@ -34,10 +34,11 @@ TransactionListItem.prototype.showRetryButton = function () {
const currentNonce = txParams.nonce const currentNonce = txParams.nonce
const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce) const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce)
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted') const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')
const isLastSubmittedTxWithCurrentNonce = const lastSubmittedTxWithCurrentNonce = currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1]
currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1].id === transaction.id const currentTxIsLatestWithNonce = lastSubmittedTxWithCurrentNonce
&& lastSubmittedTxWithCurrentNonce.id === transaction.id
return isLastSubmittedTxWithCurrentNonce && Date.now() - submittedTime > 30000 return currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000
} }
TransactionListItem.prototype.render = function () { TransactionListItem.prototype.render = function () {

@ -186,10 +186,11 @@ TxListItem.prototype.showRetryButton = function () {
const currentNonce = txParams.nonce const currentNonce = txParams.nonce
const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce) const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce)
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => transactionStatus === 'submitted') const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => transactionStatus === 'submitted')
const isLastSubmittedTxWithCurrentNonce = const lastSubmittedTxWithCurrentNonce = currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1]
currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1].id === transactionId const currentTxIsLatestWithNonce = lastSubmittedTxWithCurrentNonce
&& lastSubmittedTxWithCurrentNonce.id === transactionId
return isLastSubmittedTxWithCurrentNonce && Date.now() - transactionSubmittedTime > 30000 return currentTxIsLatestWithNonce && Date.now() - submittedTime > 30000
} }
TxListItem.prototype.resubmit = function () { TxListItem.prototype.resubmit = function () {

Loading…
Cancel
Save