1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Send refactor: fix amount max button for tokens.

This commit is contained in:
Dan 2018-05-23 16:56:13 -02:30
parent 440905125d
commit c4e48d9263
2 changed files with 13 additions and 2 deletions

View File

@ -790,7 +790,7 @@ function updateSendTokenBalance ({
.then(usersToken => {
if (usersToken) {
const newTokenBalance = calcTokenBalance({ selectedToken, usersToken })
dispatch(setSendTokenBalance(newTokenBalance))
dispatch(setSendTokenBalance(newTokenBalance.toString(10)))
}
})
.catch(err => {

View File

@ -82,7 +82,7 @@ export default class SendTransactionScreen extends PersistentForm {
} = prevProps
const uninitialized = [prevBalance, prevGasTotal].every(n => n === null)
console.log(`@#@# uninitialized`, uninitialized);
if (!uninitialized) {
const amountErrorRequiresUpdate = doesAmountErrorRequireUpdate({
balance,
@ -120,6 +120,17 @@ export default class SendTransactionScreen extends PersistentForm {
}
componentWillMount () {
const {
from: { address, balance },
selectedToken,
tokenContract,
updateSendTokenBalance,
} = this.props
updateSendTokenBalance({
selectedToken,
tokenContract,
address,
})
this.updateGas()
}