aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-28 21:21:16 +0800
committerDan <danjm.com@gmail.com>2018-03-28 21:21:16 +0800
commit21b6a3442d8cae8c95a3d7e0b9e216d91bc8bd19 (patch)
treef2d5eb36b31b2e14dc3ed9181e4da082ce0af23d
parent871edfe12ad37545c596e2e926afc458c0efa559 (diff)
downloadtangerine-wallet-browser-21b6a3442d8cae8c95a3d7e0b9e216d91bc8bd19.tar
tangerine-wallet-browser-21b6a3442d8cae8c95a3d7e0b9e216d91bc8bd19.tar.gz
tangerine-wallet-browser-21b6a3442d8cae8c95a3d7e0b9e216d91bc8bd19.tar.bz2
tangerine-wallet-browser-21b6a3442d8cae8c95a3d7e0b9e216d91bc8bd19.tar.lz
tangerine-wallet-browser-21b6a3442d8cae8c95a3d7e0b9e216d91bc8bd19.tar.xz
tangerine-wallet-browser-21b6a3442d8cae8c95a3d7e0b9e216d91bc8bd19.tar.zst
tangerine-wallet-browser-21b6a3442d8cae8c95a3d7e0b9e216d91bc8bd19.zip
Fix display of unapprovedMessages in txList (old and new ui); includes fix of undefined txParams.
-rw-r--r--old-ui/app/components/transaction-list-item.js5
-rw-r--r--ui/app/components/tx-list-item.js20
-rw-r--r--ui/app/components/tx-list.js5
3 files changed, 21 insertions, 9 deletions
diff --git a/old-ui/app/components/transaction-list-item.js b/old-ui/app/components/transaction-list-item.js
index 7ab3414e5..f7d59005a 100644
--- a/old-ui/app/components/transaction-list-item.js
+++ b/old-ui/app/components/transaction-list-item.js
@@ -31,6 +31,11 @@ function TransactionListItem () {
TransactionListItem.prototype.showRetryButton = function () {
const { transaction = {}, transactions } = this.props
const { status, submittedTime, txParams } = transaction
+
+ if (!txParams) {
+ return false
+ }
+
const currentNonce = txParams.nonce
const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce)
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')
diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js
index 5e88d38d3..a411edd89 100644
--- a/ui/app/components/tx-list-item.js
+++ b/ui/app/components/tx-list-item.js
@@ -62,20 +62,23 @@ TxListItem.prototype.getAddressText = function () {
const {
address,
txParams = {},
+ isMsg,
} = this.props
const decodedData = txParams.data && abiDecoder.decodeMethod(txParams.data)
const { name: txDataName, params = [] } = decodedData || {}
const { value } = params[0] || {}
- switch (txDataName) {
- case 'transfer':
- return `${value.slice(0, 10)}...${value.slice(-4)}`
- default:
- return address
- ? `${address.slice(0, 10)}...${address.slice(-4)}`
- : this.props.t('contractDeployment')
+ let addressText
+ if (txDataName === 'transfer' || address) {
+ addressText = `${value.slice(0, 10)}...${value.slice(-4)}`
+ } else if (isMsg) {
+ addressText = this.props.t('sigRequest')
+ } else {
+ addressText = this.props.t('contractDeployment')
}
+
+ return addressText
}
TxListItem.prototype.getSendEtherTotal = function () {
@@ -185,6 +188,9 @@ TxListItem.prototype.showRetryButton = function () {
transactionId,
txParams,
} = this.props
+ if (!txParams) {
+ return false
+ }
const currentNonce = txParams.nonce
const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce)
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')
diff --git a/ui/app/components/tx-list.js b/ui/app/components/tx-list.js
index 5f09d887e..b8619fbf1 100644
--- a/ui/app/components/tx-list.js
+++ b/ui/app/components/tx-list.js
@@ -71,9 +71,9 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
const props = {
dateString: formatDate(transaction.time),
- address: transaction.txParams.to,
+ address: transaction.txParams && transaction.txParams.to,
transactionStatus: transaction.status,
- transactionAmount: transaction.txParams.value,
+ transactionAmount: transaction.txParams && transaction.txParams.value,
transactionId: transaction.id,
transactionHash: transaction.hash,
transactionNetworkId: transaction.metamaskNetworkId,
@@ -95,6 +95,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
const opts = {
key: transactionId || transactionHash,
txParams: transaction.txParams,
+ isMsg: Boolean(transaction.msgParams),
transactionStatus,
transactionId,
dateString,