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

Fix setting of token balance on account switch in send screen from field.

This commit is contained in:
Dan 2018-05-30 13:35:01 -02:30
parent e712336189
commit 5347319dff
3 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ function mapDispatchToProps (dispatch) {
setSendTokenBalance: (usersToken, selectedToken) => { setSendTokenBalance: (usersToken, selectedToken) => {
if (!usersToken) return if (!usersToken) return
const tokenBalance = calcTokenBalance(usersToken, selectedToken) const tokenBalance = calcTokenBalance({ usersToken, selectedToken })
dispatch(setSendTokenBalance(tokenBalance)) dispatch(setSendTokenBalance(tokenBalance))
}, },
} }

View File

@ -29,7 +29,7 @@ proxyquire('../send-from-row.container.js', {
getSendFromObject: (s) => `mockFrom:${s}`, getSendFromObject: (s) => `mockFrom:${s}`,
}, },
'./send-from-row.selectors.js': { getFromDropdownOpen: (s) => `mockFromDropdownOpen:${s}` }, './send-from-row.selectors.js': { getFromDropdownOpen: (s) => `mockFromDropdownOpen:${s}` },
'../../send.utils.js': { calcTokenBalance: (a, b) => a + b }, '../../send.utils.js': { calcTokenBalance: ({ usersToken, selectedToken }) => usersToken + selectedToken },
'../../../../actions': actionSpies, '../../../../actions': actionSpies,
'../../../../ducks/send.duck': duckActionSpies, '../../../../ducks/send.duck': duckActionSpies,
}) })

View File

@ -158,7 +158,7 @@ function getParamsForGasEstimate (selectedAddress, symbol, data) {
function calcTokenBalance ({ selectedToken, usersToken }) { function calcTokenBalance ({ selectedToken, usersToken }) {
const { decimals } = selectedToken || {} const { decimals } = selectedToken || {}
return calcTokenAmount(usersToken.balance.toString(), decimals) return calcTokenAmount(usersToken.balance.toString(), decimals) + ''
} }
function doesAmountErrorRequireUpdate ({ function doesAmountErrorRequireUpdate ({