fix(@desktop/wallet): Fix for Coins balance is copypasted

fixes #6091
This commit is contained in:
Khushboo Mehta 2022-06-17 10:35:11 +05:30 committed by Iuri Matias
parent 2112135c6f
commit ad4b2c5e6f
1 changed files with 10 additions and 4 deletions

View File

@ -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)
for symbol, tokens in groupedTokens.pairs:
# Reset
enabledNetworkBalance = BalanceDto(
balance: 0.0,
currencyBalance: 0.0
)
for symbol, tokens in groupedTokens.pairs:
var balancesPerChain = initTable[int, BalanceDto]()
var visible = false