aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-31 00:05:01 +0800
committerDan <danjm.com@gmail.com>2018-05-31 00:05:01 +0800
commit5347319dffa0a9e4df5fe26d5ea60293b3489f78 (patch)
tree02bbfd0047cc46bd0013d55f9ccbe56e33dc52ae
parente712336189e1a0a453ea30dbb58abbc3c57db8f8 (diff)
downloadtangerine-wallet-browser-5347319dffa0a9e4df5fe26d5ea60293b3489f78.tar
tangerine-wallet-browser-5347319dffa0a9e4df5fe26d5ea60293b3489f78.tar.gz
tangerine-wallet-browser-5347319dffa0a9e4df5fe26d5ea60293b3489f78.tar.bz2
tangerine-wallet-browser-5347319dffa0a9e4df5fe26d5ea60293b3489f78.tar.lz
tangerine-wallet-browser-5347319dffa0a9e4df5fe26d5ea60293b3489f78.tar.xz
tangerine-wallet-browser-5347319dffa0a9e4df5fe26d5ea60293b3489f78.tar.zst
tangerine-wallet-browser-5347319dffa0a9e4df5fe26d5ea60293b3489f78.zip
Fix setting of token balance on account switch in send screen from field.
-rw-r--r--ui/app/components/send_/send-content/send-from-row/send-from-row.container.js2
-rw-r--r--ui/app/components/send_/send-content/send-from-row/tests/send-from-row-container.test.js2
-rw-r--r--ui/app/components/send_/send.utils.js2
3 files changed, 3 insertions, 3 deletions
diff --git a/ui/app/components/send_/send-content/send-from-row/send-from-row.container.js b/ui/app/components/send_/send-content/send-from-row/send-from-row.container.js
index 402b744e4..33cb63b43 100644
--- a/ui/app/components/send_/send-content/send-from-row/send-from-row.container.js
+++ b/ui/app/components/send_/send-content/send-from-row/send-from-row.container.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))
},
}
diff --git a/ui/app/components/send_/send-content/send-from-row/tests/send-from-row-container.test.js b/ui/app/components/send_/send-content/send-from-row/tests/send-from-row-container.test.js
index 785b3d3ef..e080b2fe3 100644
--- a/ui/app/components/send_/send-content/send-from-row/tests/send-from-row-container.test.js
+++ b/ui/app/components/send_/send-content/send-from-row/tests/send-from-row-container.test.js
@@ -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,
})
diff --git a/ui/app/components/send_/send.utils.js b/ui/app/components/send_/send.utils.js
index f09a02a6a..71a8a35c4 100644
--- a/ui/app/components/send_/send.utils.js
+++ b/ui/app/components/send_/send.utils.js
@@ -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 ({