aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2019-03-30 00:05:23 +0800
committerDan Miller <danjm.com@gmail.com>2019-03-30 01:53:55 +0800
commit8458873a2002b518075209276941878829d02162 (patch)
treec5ec72970f81bed8d63203b5853523c9ddb44c5e /ui
parent1d14646a4cb5d35753943b9c8cc8dfe2fb3e7769 (diff)
downloadtangerine-wallet-browser-8458873a2002b518075209276941878829d02162.tar
tangerine-wallet-browser-8458873a2002b518075209276941878829d02162.tar.gz
tangerine-wallet-browser-8458873a2002b518075209276941878829d02162.tar.bz2
tangerine-wallet-browser-8458873a2002b518075209276941878829d02162.tar.lz
tangerine-wallet-browser-8458873a2002b518075209276941878829d02162.tar.xz
tangerine-wallet-browser-8458873a2002b518075209276941878829d02162.tar.zst
tangerine-wallet-browser-8458873a2002b518075209276941878829d02162.zip
Ensure correct confirm screen in case of smartcontract check fail
Diffstat (limited to 'ui')
-rw-r--r--ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js4
-rw-r--r--ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.container.js6
2 files changed, 9 insertions, 1 deletions
diff --git a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js
index cd471b822..25f2402f1 100644
--- a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js
+++ b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js
@@ -25,6 +25,7 @@ export default class ConfirmTransactionSwitch extends Component {
methodData: PropTypes.object,
fetchingData: PropTypes.bool,
isEtherTransaction: PropTypes.bool,
+ isTokenMethod: PropTypes.bool,
}
redirectToTransaction () {
@@ -33,6 +34,7 @@ export default class ConfirmTransactionSwitch extends Component {
methodData: { name },
fetchingData,
isEtherTransaction,
+ isTokenMethod,
} = this.props
const { id, txParams: { data } = {} } = txData
@@ -45,7 +47,7 @@ export default class ConfirmTransactionSwitch extends Component {
return <Redirect to={{ pathname }} />
}
- if (isEtherTransaction) {
+ if (isEtherTransaction && !isTokenMethod) {
const pathname = `${CONFIRM_TRANSACTION_ROUTE}/${id}${CONFIRM_SEND_ETHER_PATH}`
return <Redirect to={{ pathname }} />
}
diff --git a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.container.js b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.container.js
index 7f2c36af2..c0b01a11e 100644
--- a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.container.js
+++ b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.container.js
@@ -1,5 +1,10 @@
import { connect } from 'react-redux'
import ConfirmTransactionSwitch from './confirm-transaction-switch.component'
+import {
+ TOKEN_METHOD_TRANSFER,
+ TOKEN_METHOD_APPROVE,
+ TOKEN_METHOD_TRANSFER_FROM,
+} from '../../helpers/constants/transactions'
const mapStateToProps = state => {
const {
@@ -16,6 +21,7 @@ const mapStateToProps = state => {
methodData,
fetchingData,
isEtherTransaction: !toSmartContract,
+ isTokenMethod: [TOKEN_METHOD_APPROVE, TOKEN_METHOD_TRANSFER, TOKEN_METHOD_TRANSFER_FROM].includes(methodData.name)
}
}