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

feature/default_network_editable
Dan 7 years ago
parent e712336189
commit 5347319dff
  1. 2
      ui/app/components/send_/send-content/send-from-row/send-from-row.container.js
  2. 2
      ui/app/components/send_/send-content/send-from-row/tests/send-from-row-container.test.js
  3. 2
      ui/app/components/send_/send.utils.js

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

@ -29,7 +29,7 @@ proxyquire('../send-from-row.container.js', {
getSendFromObject: (s) => `mockFrom:${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,
'../../../../ducks/send.duck': duckActionSpies,
})

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

Loading…
Cancel
Save