mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Undefined check in showRetryButton
This commit is contained in:
parent
e293b6349c
commit
8c7988978f
@ -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 () {
|
||||
|
@ -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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user