aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-14 07:39:04 +0800
committerDan <danjm.com@gmail.com>2018-03-14 07:45:35 +0800
commitd6e4d2e80d05f64bb543e524c6288b8b7c33e4c1 (patch)
tree8d352cc48bdccc3173e33f220fdafcd9f88d1320
parent9d7640996aa9b63fb6c9271d7e0698e7acdc559e (diff)
downloadtangerine-wallet-browser-d6e4d2e80d05f64bb543e524c6288b8b7c33e4c1.tar
tangerine-wallet-browser-d6e4d2e80d05f64bb543e524c6288b8b7c33e4c1.tar.gz
tangerine-wallet-browser-d6e4d2e80d05f64bb543e524c6288b8b7c33e4c1.tar.bz2
tangerine-wallet-browser-d6e4d2e80d05f64bb543e524c6288b8b7c33e4c1.tar.lz
tangerine-wallet-browser-d6e4d2e80d05f64bb543e524c6288b8b7c33e4c1.tar.xz
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.
-rw-r--r--old-ui/app/components/transaction-list-item.js12
-rw-r--r--old-ui/app/components/transaction-list.js2
-rw-r--r--ui/app/components/pending-tx/confirm-send-ether.js2
-rw-r--r--ui/app/components/tx-list-item.js10
-rw-r--r--ui/app/components/tx-list.js6
5 files changed, 19 insertions, 13 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 () {
diff --git a/old-ui/app/components/transaction-list.js b/old-ui/app/components/transaction-list.js
index 345e3ca16..c77852921 100644
--- a/old-ui/app/components/transaction-list.js
+++ b/old-ui/app/components/transaction-list.js
@@ -62,7 +62,7 @@ TransactionList.prototype.render = function () {
}
return h(TransactionListItem, {
transaction, i, network, key,
- conversionRate,
+ conversionRate, transactions,
showTx: (txId) => {
this.props.viewPendingTx(txId)
},
diff --git a/ui/app/components/pending-tx/confirm-send-ether.js b/ui/app/components/pending-tx/confirm-send-ether.js
index 899c2617c..8fe58482b 100644
--- a/ui/app/components/pending-tx/confirm-send-ether.js
+++ b/ui/app/components/pending-tx/confirm-send-ether.js
@@ -11,7 +11,7 @@ const hexToBn = require('../../../../app/scripts/lib/hex-to-bn')
const {
conversionUtil,
addCurrencies,
- multiplyCurrencies
+ multiplyCurrencies,
} = require('../../conversion-util')
const GasFeeDisplay = require('../send/gas-fee-display-v2')
diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js
index 62426252f..941fcb69c 100644
--- a/ui/app/components/tx-list-item.js
+++ b/ui/app/components/tx-list-item.js
@@ -178,18 +178,18 @@ TxListItem.prototype.getSendTokenTotal = async function () {
TxListItem.prototype.showRetryButton = function () {
const {
transactionStatus,
- transactionTime,
+ transactionSubmittedTime,
selectedAddressTxList,
transactionId,
txParams,
} = this.props
const currentNonce = txParams.nonce
const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce)
- const currentStatusNonceTx = currentNonceTxs.filter(tx =>
- tx.status !== 'rejected' && tx.status !== 'failed')
- const isLastPassingWithNonce = currentStatusNonceTx[currentStatusNonceTx.length - 1].id === transactionId
+ const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => transactionStatus === 'submitted')
+ const isLastSubmittedTxWithCurrentNonce =
+ currentNonceSubmittedTxs[currentNonceSubmittedTxs.length - 1].id === transactionId
- return transactionStatus === 'submitted' && isLastPassingWithNonce && Date.now() - transactionTime > 30000
+ return isLastSubmittedTxWithCurrentNonce && Date.now() - transactionSubmittedTime > 30000
}
TxListItem.prototype.resubmit = function () {
diff --git a/ui/app/components/tx-list.js b/ui/app/components/tx-list.js
index 30f816d58..add70a266 100644
--- a/ui/app/components/tx-list.js
+++ b/ui/app/components/tx-list.js
@@ -77,7 +77,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
transactionId: transaction.id,
transactionHash: transaction.hash,
transactionNetworkId: transaction.metamaskNetworkId,
- transactionTime: transaction.time,
+ transactionSubmittedTime: transaction.transactionSubmittedTime,
}
const {
@@ -88,7 +88,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
transactionId,
transactionHash,
transactionNetworkId,
- transactionTime,
+ transactionSubmittedTime,
} = props
const { showConfTxPage } = this.props
@@ -103,7 +103,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
transactionHash,
conversionRate,
tokenInfoGetter: this.tokenInfoGetter,
- transactionTime,
+ transactionSubmittedTime,
}
const isUnapproved = transactionStatus === 'unapproved'