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:
parent
440905125d
commit
c4e48d9263
@ -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 => {
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user