aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-03-22 04:12:59 +0800
committerkumavis <aaron@kumavis.me>2018-03-22 04:12:59 +0800
commit3e79941658e58f5ef74cd9545c2b69136362ec76 (patch)
tree51c188de17147c9deaa263c71d6f6f141ea8a7e7
parent3595d71c2d01d08fe1692ef4fe2f4d6d5c3241d9 (diff)
downloadtangerine-wallet-browser-3e79941658e58f5ef74cd9545c2b69136362ec76.tar.gz
tangerine-wallet-browser-3e79941658e58f5ef74cd9545c2b69136362ec76.tar.zst
tangerine-wallet-browser-3e79941658e58f5ef74cd9545c2b69136362ec76.zip
ui - tx conf - only show special token tx conf screen for token send
-rw-r--r--ui/app/components/pending-tx/index.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/app/components/pending-tx/index.js b/ui/app/components/pending-tx/index.js
index 9676e9c86..9c0453a3b 100644
--- a/ui/app/components/pending-tx/index.js
+++ b/ui/app/components/pending-tx/index.js
@@ -63,10 +63,14 @@ PendingTx.prototype.componentWillMount = async function () {
isFetching: false,
})
}
- const tokenData = txParams && abiDecoder.decodeMethod(txParams.data)
- const { name: tokenMethodName } = tokenData || {}
- const isTokenTransaction = ['transfer', 'approve', 'transferFrom']
- .find(possibleName => tokenMethodName === possibleName)
+
+ // inspect tx data for supported special confirmation screens
+ let isTokenTransaction = false
+ if (txParams.data) {
+ const tokenData = abiDecoder.decodeMethod(txParams.data)
+ const { name: tokenMethodName } = tokenData || {}
+ isTokenTransaction = (tokenMethodName === 'transfer')
+ }
if (isTokenTransaction) {
const token = util.getContractAtAddress(txParams.to)