aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-24 03:26:13 +0800
committerDan <danjm.com@gmail.com>2018-05-24 03:26:13 +0800
commitc4e48d9263cb251695afc28d936f7abb0e033f5c (patch)
treeb3ea7cf024a7974467af82dfc76ce22f93b49a19 /ui
parent440905125d77d1d5d72d1aceac2940925a8ac38f (diff)
downloadtangerine-wallet-browser-c4e48d9263cb251695afc28d936f7abb0e033f5c.tar
tangerine-wallet-browser-c4e48d9263cb251695afc28d936f7abb0e033f5c.tar.gz
tangerine-wallet-browser-c4e48d9263cb251695afc28d936f7abb0e033f5c.tar.bz2
tangerine-wallet-browser-c4e48d9263cb251695afc28d936f7abb0e033f5c.tar.lz
tangerine-wallet-browser-c4e48d9263cb251695afc28d936f7abb0e033f5c.tar.xz
tangerine-wallet-browser-c4e48d9263cb251695afc28d936f7abb0e033f5c.tar.zst
tangerine-wallet-browser-c4e48d9263cb251695afc28d936f7abb0e033f5c.zip
Send refactor: fix amount max button for tokens.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/actions.js2
-rw-r--r--ui/app/components/send_/send.component.js13
2 files changed, 13 insertions, 2 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 071f56209..fc2a838d4 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -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 => {
diff --git a/ui/app/components/send_/send.component.js b/ui/app/components/send_/send.component.js
index 4cfac1bde..49731ff6a 100644
--- a/ui/app/components/send_/send.component.js
+++ b/ui/app/components/send_/send.component.js
@@ -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()
}