aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx/confirm-send-ether.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-06-08 01:07:36 +0800
committerkumavis <aaron@kumavis.me>2018-06-08 01:07:36 +0800
commit66b703b1a4ba25ddaf8278f020967b4d20351027 (patch)
tree41520dbc3ad35b3c9968cfc390ecb99db5456a33 /ui/app/components/pending-tx/confirm-send-ether.js
parent2198276bd533bec767cad954ef8b21c47c0f8c09 (diff)
parent988283778a2be52640b27a359ef3fb1130e95711 (diff)
downloadtangerine-wallet-browser-66b703b1a4ba25ddaf8278f020967b4d20351027.tar.gz
tangerine-wallet-browser-66b703b1a4ba25ddaf8278f020967b4d20351027.tar.zst
tangerine-wallet-browser-66b703b1a4ba25ddaf8278f020967b4d20351027.zip
Merge branch 'develop' of github.com:MetaMask/metamask-extension into network-remove-provider-engine
Diffstat (limited to 'ui/app/components/pending-tx/confirm-send-ether.js')
-rw-r--r--ui/app/components/pending-tx/confirm-send-ether.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/ui/app/components/pending-tx/confirm-send-ether.js b/ui/app/components/pending-tx/confirm-send-ether.js
index 5ad35c269..97d0318ea 100644
--- a/ui/app/components/pending-tx/confirm-send-ether.js
+++ b/ui/app/components/pending-tx/confirm-send-ether.js
@@ -17,22 +17,26 @@ const {
multiplyCurrencies,
} = require('../../conversion-util')
const {
- getGasTotal,
+ calcGasTotal,
isBalanceSufficient,
-} = require('../send/send-utils')
+} = require('../send_/send.utils')
const GasFeeDisplay = require('../send/gas-fee-display-v2')
const SenderToRecipient = require('../sender-to-recipient')
const NetworkDisplay = require('../network-display')
const currencyFormatter = require('currency-formatter')
const currencies = require('currency-formatter/currencies')
-const { MIN_GAS_PRICE_HEX } = require('../send/send-constants')
+const { MIN_GAS_PRICE_HEX } = require('../send_/send.constants')
const { SEND_ROUTE, DEFAULT_ROUTE } = require('../../routes')
const {
ENVIRONMENT_TYPE_POPUP,
ENVIRONMENT_TYPE_NOTIFICATION,
} = require('../../../../app/scripts/lib/enums')
+import {
+ updateSendErrors,
+} from '../../ducks/send.duck'
+
ConfirmSendEther.contextTypes = {
t: PropTypes.func,
}
@@ -109,7 +113,7 @@ function mapDispatchToProps (dispatch) {
}))
dispatch(actions.showModal({ name: 'CUSTOMIZE_GAS' }))
},
- updateSendErrors: error => dispatch(actions.updateSendErrors(error)),
+ updateSendErrors: error => dispatch(updateSendErrors(error)),
}
}
@@ -145,7 +149,7 @@ ConfirmSendEther.prototype.updateComponentSendErrors = function (prevProps) {
if (shouldUpdateBalanceSendErrors) {
const balanceIsSufficient = this.isBalanceSufficient(txMeta)
updateSendErrors({
- insufficientFunds: balanceIsSufficient ? false : this.context.t('insufficientFunds'),
+ insufficientFunds: balanceIsSufficient ? false : 'insufficientFunds',
})
}
@@ -153,7 +157,7 @@ ConfirmSendEther.prototype.updateComponentSendErrors = function (prevProps) {
if (shouldUpdateSimulationSendError) {
updateSendErrors({
- simulationFails: !txMeta.simulationFails ? false : this.context.t('transactionError'),
+ simulationFails: !txMeta.simulationFails ? false : 'transactionError',
})
}
}
@@ -585,9 +589,9 @@ ConfirmSendEther.prototype.onSubmit = function (event) {
if (valid && this.verifyGasParams() && balanceIsSufficient) {
this.props.sendTransaction(txMeta, event)
} else if (!balanceIsSufficient) {
- updateSendErrors({ insufficientFunds: this.context.t('insufficientFunds') })
+ updateSendErrors({ insufficientFunds: 'insufficientFunds' })
} else {
- updateSendErrors({ invalidGasParams: this.context.t('invalidGasParams') })
+ updateSendErrors({ invalidGasParams: 'invalidGasParams' })
this.setState({ submitting: false })
}
}
@@ -612,7 +616,7 @@ ConfirmSendEther.prototype.isBalanceSufficient = function (txMeta) {
value: amount,
},
} = txMeta
- const gasTotal = getGasTotal(gas, gasPrice)
+ const gasTotal = calcGasTotal(gas, gasPrice)
return isBalanceSufficient({
amount,