From ad4b2c5e6fe3751515407f6e29401e6c41ae0eb1 Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Fri, 17 Jun 2022 10:35:11 +0530 Subject: [PATCH] fix(@desktop/wallet): Fix for Coins balance is copypasted fixes #6091 --- .../service/wallet_account/async_tasks.nim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app_service/service/wallet_account/async_tasks.nim b/src/app_service/service/wallet_account/async_tasks.nim index 6273bdb58e..daa218aa36 100644 --- a/src/app_service/service/wallet_account/async_tasks.nim +++ b/src/app_service/service/wallet_account/async_tasks.nim @@ -230,6 +230,11 @@ const prepareTokensTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} = currencyBalance: 0.0 ) for networkNativeCurrencySymbol, networks in groupedNetworks.pairs: + # Reset + enabledNetworkBalance = BalanceDto( + balance: 0.0, + currencyBalance: 0.0 + ) var balancesPerChain = initTable[int, BalanceDto]() for network in networks: let chainBalance = fetchNativeChainBalance(network.chainId, network.nativeCurrencyDecimals, address) @@ -262,11 +267,12 @@ const prepareTokensTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} = ) let groupedTokens = groupTokensBySymbol(allTokens) - enabledNetworkBalance = BalanceDto( - balance: 0.0, - currencyBalance: 0.0 - ) for symbol, tokens in groupedTokens.pairs: + # Reset + enabledNetworkBalance = BalanceDto( + balance: 0.0, + currencyBalance: 0.0 + ) var balancesPerChain = initTable[int, BalanceDto]() var visible = false