aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-03-31 09:36:39 +0800
committerGitHub <noreply@github.com>2018-03-31 09:36:39 +0800
commitee1acf0a7ea490e4d22efdf22dec984cd7ba6a6a (patch)
treedf16cf2704f647e404c97a43e6543543806d2fad
parent2e57c36f36165e85cabeffc3cf0ade4998e352e1 (diff)
parent717623e2e388f488d71bd6e19095645cd8095a99 (diff)
downloadtangerine-wallet-browser-ee1acf0a7ea490e4d22efdf22dec984cd7ba6a6a.tar
tangerine-wallet-browser-ee1acf0a7ea490e4d22efdf22dec984cd7ba6a6a.tar.gz
tangerine-wallet-browser-ee1acf0a7ea490e4d22efdf22dec984cd7ba6a6a.tar.bz2
tangerine-wallet-browser-ee1acf0a7ea490e4d22efdf22dec984cd7ba6a6a.tar.lz
tangerine-wallet-browser-ee1acf0a7ea490e4d22efdf22dec984cd7ba6a6a.tar.xz
tangerine-wallet-browser-ee1acf0a7ea490e4d22efdf22dec984cd7ba6a6a.tar.zst
tangerine-wallet-browser-ee1acf0a7ea490e4d22efdf22dec984cd7ba6a6a.zip
Merge pull request #3774 from danjm/i3686-txparamundefined-sigrequestsintxlist
Fix display of unapprovedMgs in txList; fix txParams undefined errors
-rw-r--r--old-ui/app/components/transaction-list-item.js5
-rw-r--r--ui/app/components/tx-list-item.js21
-rw-r--r--ui/app/components/tx-list.js5
3 files changed, 22 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 622664786..42c008798 100644
--- a/ui/app/components/tx-list-item.js
+++ b/ui/app/components/tx-list-item.js
@@ -68,20 +68,24 @@ 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.context.t('contractDeployment')
+ let addressText
+ if (txDataName === 'transfer' || address) {
+ const addressToRender = txDataName === 'transfer' ? value : address
+ addressText = `${addressToRender.slice(0, 10)}...${addressToRender.slice(-4)}`
+ } else if (isMsg) {
+ addressText = this.context.t('sigRequest')
+ } else {
+ addressText = this.context.t('contractDeployment')
}
+
+ return addressText
}
TxListItem.prototype.getSendEtherTotal = function () {
@@ -191,6 +195,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 fa01c7b29..740c4a4ab 100644
--- a/ui/app/components/tx-list.js
+++ b/ui/app/components/tx-list.js
@@ -77,9 +77,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,
@@ -101,6 +101,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
const opts = {
key: transactionId || transactionHash,
txParams: transaction.txParams,
+ isMsg: Boolean(transaction.msgParams),
transactionStatus,
transactionId,
dateString,