aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/tx-list-item.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-04-03 05:13:45 +0800
committerkumavis <aaron@kumavis.me>2018-04-03 05:13:45 +0800
commit98e0fc1ab95c17b9ea19eed04b1e60dc9ea9dccb (patch)
tree23176562ed22c97daa13f4f8f1081b581f2ba2b1 /ui/app/components/tx-list-item.js
parent8db097d8d9307bc7a0bbb0cd802ad30ad0fc2740 (diff)
parentfd30fabfbd7707adf2e4bc3606362c1687aeed9a (diff)
downloadtangerine-wallet-browser-98e0fc1ab95c17b9ea19eed04b1e60dc9ea9dccb.tar.gz
tangerine-wallet-browser-98e0fc1ab95c17b9ea19eed04b1e60dc9ea9dccb.tar.zst
tangerine-wallet-browser-98e0fc1ab95c17b9ea19eed04b1e60dc9ea9dccb.zip
Merge branch 'master' of github.com:MetaMask/metamask-extension into ci-screens
Diffstat (limited to 'ui/app/components/tx-list-item.js')
-rw-r--r--ui/app/components/tx-list-item.js21
1 files changed, 14 insertions, 7 deletions
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')