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 => {
|
.then(usersToken => {
|
||||||
if (usersToken) {
|
if (usersToken) {
|
||||||
const newTokenBalance = calcTokenBalance({ selectedToken, usersToken })
|
const newTokenBalance = calcTokenBalance({ selectedToken, usersToken })
|
||||||
dispatch(setSendTokenBalance(newTokenBalance))
|
dispatch(setSendTokenBalance(newTokenBalance.toString(10)))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
@ -82,7 +82,7 @@ export default class SendTransactionScreen extends PersistentForm {
|
|||||||
} = prevProps
|
} = prevProps
|
||||||
|
|
||||||
const uninitialized = [prevBalance, prevGasTotal].every(n => n === null)
|
const uninitialized = [prevBalance, prevGasTotal].every(n => n === null)
|
||||||
|
console.log(`@#@# uninitialized`, uninitialized);
|
||||||
if (!uninitialized) {
|
if (!uninitialized) {
|
||||||
const amountErrorRequiresUpdate = doesAmountErrorRequireUpdate({
|
const amountErrorRequiresUpdate = doesAmountErrorRequireUpdate({
|
||||||
balance,
|
balance,
|
||||||
@ -120,6 +120,17 @@ export default class SendTransactionScreen extends PersistentForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount () {
|
componentWillMount () {
|
||||||
|
const {
|
||||||
|
from: { address, balance },
|
||||||
|
selectedToken,
|
||||||
|
tokenContract,
|
||||||
|
updateSendTokenBalance,
|
||||||
|
} = this.props
|
||||||
|
updateSendTokenBalance({
|
||||||
|
selectedToken,
|
||||||
|
tokenContract,
|
||||||
|
address,
|
||||||
|
})
|
||||||
this.updateGas()
|
this.updateGas()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user