From 3e79941658e58f5ef74cd9545c2b69136362ec76 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 21 Mar 2018 13:12:59 -0700 Subject: [PATCH] ui - tx conf - only show special token tx conf screen for token send --- ui/app/components/pending-tx/index.js | 12 ++++++++---- 1 file 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)