Show insufficient funds on confirm screen on first render.

feature/default_network_editable
Dan 7 years ago
parent d6ebf5d94e
commit a4594f6838
  1. 12
      ui/app/components/pending-tx/confirm-send-ether.js
  2. 10
      ui/app/components/pending-tx/confirm-send-token.js

@ -103,6 +103,18 @@ function ConfirmSendEther () {
this.onSubmit = this.onSubmit.bind(this)
}
ConfirmSendEther.prototype.componentWillMount = function () {
const { updateSendErrors } = this.props
const txMeta = this.gatherTxMeta()
const balanceIsSufficient = this.isBalanceSufficient(txMeta)
updateSendErrors({
insufficientFunds: balanceIsSufficient
? false
: this.props.t('insufficientFunds')
})
}
ConfirmSendEther.prototype.getAmount = function () {
const { conversionRate, currentCurrency } = this.props
const txMeta = this.gatherTxMeta()

@ -142,12 +142,20 @@ function ConfirmSendToken () {
}
ConfirmSendToken.prototype.componentWillMount = function () {
const { tokenContract, selectedAddress } = this.props
const { tokenContract, selectedAddress, updateSendErrors} = this.props
const txMeta = this.gatherTxMeta()
const balanceIsSufficient = this.isBalanceSufficient(txMeta)
tokenContract && tokenContract
.balanceOf(selectedAddress)
.then(usersToken => {
})
this.props.updateTokenExchangeRate()
updateSendErrors({
insufficientFunds: balanceIsSufficient
? false
: this.props.t('insufficientFunds')
})
}
ConfirmSendToken.prototype.getAmount = function () {

Loading…
Cancel
Save