Fix display of unapprovedMessages in txList (old and new ui); includes fix of undefined txParams.

feature/default_network_editable
Dan 7 years ago
parent 871edfe12a
commit 21b6a3442d
  1. 5
      old-ui/app/components/transaction-list-item.js
  2. 20
      ui/app/components/tx-list-item.js
  3. 5
      ui/app/components/tx-list.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')

@ -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')

@ -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,

Loading…
Cancel
Save