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

Compare convert ethBalance to decimal before comparing to fromTokenBalance in useEffect for eth token balance update (#9607)

This commit is contained in:
Dan J Miller 2020-10-14 16:48:21 -02:30 committed by GitHub
parent c39617e111
commit 0558689636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,7 +166,7 @@ export default function BuildQuote ({
// If the eth balance changes while on build quote, we update the selected from token
useEffect(() => {
if (fromToken?.address === ETH_SWAPS_TOKEN_OBJECT.address && (fromToken?.balance !== ethBalance)) {
if (fromToken?.address === ETH_SWAPS_TOKEN_OBJECT.address && (fromToken?.balance !== hexToDecimal(ethBalance))) {
dispatch(setSwapsFromToken({
...fromToken,
balance: hexToDecimal(ethBalance),