mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #3774 from danjm/i3686-txparamundefined-sigrequestsintxlist
Fix display of unapprovedMgs in txList; fix txParams undefined errors
This commit is contained in:
commit
ee1acf0a7e
@ -31,6 +31,11 @@ function TransactionListItem () {
|
|||||||
TransactionListItem.prototype.showRetryButton = function () {
|
TransactionListItem.prototype.showRetryButton = function () {
|
||||||
const { transaction = {}, transactions } = this.props
|
const { transaction = {}, transactions } = this.props
|
||||||
const { status, submittedTime, txParams } = transaction
|
const { status, submittedTime, txParams } = transaction
|
||||||
|
|
||||||
|
if (!txParams) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
const currentNonce = txParams.nonce
|
const currentNonce = txParams.nonce
|
||||||
const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce)
|
const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce)
|
||||||
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')
|
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')
|
||||||
|
@ -68,20 +68,24 @@ TxListItem.prototype.getAddressText = function () {
|
|||||||
const {
|
const {
|
||||||
address,
|
address,
|
||||||
txParams = {},
|
txParams = {},
|
||||||
|
isMsg,
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
const decodedData = txParams.data && abiDecoder.decodeMethod(txParams.data)
|
const decodedData = txParams.data && abiDecoder.decodeMethod(txParams.data)
|
||||||
const { name: txDataName, params = [] } = decodedData || {}
|
const { name: txDataName, params = [] } = decodedData || {}
|
||||||
const { value } = params[0] || {}
|
const { value } = params[0] || {}
|
||||||
|
|
||||||
switch (txDataName) {
|
let addressText
|
||||||
case 'transfer':
|
if (txDataName === 'transfer' || address) {
|
||||||
return `${value.slice(0, 10)}...${value.slice(-4)}`
|
const addressToRender = txDataName === 'transfer' ? value : address
|
||||||
default:
|
addressText = `${addressToRender.slice(0, 10)}...${addressToRender.slice(-4)}`
|
||||||
return address
|
} else if (isMsg) {
|
||||||
? `${address.slice(0, 10)}...${address.slice(-4)}`
|
addressText = this.context.t('sigRequest')
|
||||||
: this.context.t('contractDeployment')
|
} else {
|
||||||
|
addressText = this.context.t('contractDeployment')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return addressText
|
||||||
}
|
}
|
||||||
|
|
||||||
TxListItem.prototype.getSendEtherTotal = function () {
|
TxListItem.prototype.getSendEtherTotal = function () {
|
||||||
@ -191,6 +195,9 @@ TxListItem.prototype.showRetryButton = function () {
|
|||||||
transactionId,
|
transactionId,
|
||||||
txParams,
|
txParams,
|
||||||
} = this.props
|
} = this.props
|
||||||
|
if (!txParams) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
const currentNonce = txParams.nonce
|
const currentNonce = txParams.nonce
|
||||||
const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce)
|
const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce)
|
||||||
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')
|
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')
|
||||||
|
@ -77,9 +77,9 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
|
|||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
dateString: formatDate(transaction.time),
|
dateString: formatDate(transaction.time),
|
||||||
address: transaction.txParams.to,
|
address: transaction.txParams && transaction.txParams.to,
|
||||||
transactionStatus: transaction.status,
|
transactionStatus: transaction.status,
|
||||||
transactionAmount: transaction.txParams.value,
|
transactionAmount: transaction.txParams && transaction.txParams.value,
|
||||||
transactionId: transaction.id,
|
transactionId: transaction.id,
|
||||||
transactionHash: transaction.hash,
|
transactionHash: transaction.hash,
|
||||||
transactionNetworkId: transaction.metamaskNetworkId,
|
transactionNetworkId: transaction.metamaskNetworkId,
|
||||||
@ -101,6 +101,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
|
|||||||
const opts = {
|
const opts = {
|
||||||
key: transactionId || transactionHash,
|
key: transactionId || transactionHash,
|
||||||
txParams: transaction.txParams,
|
txParams: transaction.txParams,
|
||||||
|
isMsg: Boolean(transaction.msgParams),
|
||||||
transactionStatus,
|
transactionStatus,
|
||||||
transactionId,
|
transactionId,
|
||||||
dateString,
|
dateString,
|
||||||
|
Loading…
Reference in New Issue
Block a user