diff options
ui - tx conf - only show special token tx conf screen for token send
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/pending-tx/index.js | 12 |
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) |