fix(wallet): Update balance loading state on token fetched (#14491)
This commit is contained in:
parent
59cb770ddb
commit
72a081ceca
|
@ -209,6 +209,10 @@ proc notifyModulesOnFilterChanged(self: Module) =
|
||||||
self.allCollectiblesModule.refreshWalletAccounts()
|
self.allCollectiblesModule.refreshWalletAccounts()
|
||||||
self.assetsModule.filterChanged(self.filter.addresses, self.filter.chainIds)
|
self.assetsModule.filterChanged(self.filter.addresses, self.filter.chainIds)
|
||||||
|
|
||||||
|
proc notifyModulesBalanceIsLoaded(self: Module) =
|
||||||
|
self.overviewModule.filterChanged(self.filter.addresses, self.filter.chainIds)
|
||||||
|
self.accountsModule.filterChanged(self.filter.addresses, self.filter.chainIds)
|
||||||
|
|
||||||
proc updateViewWithAddressFilterChanged(self: Module) =
|
proc updateViewWithAddressFilterChanged(self: Module) =
|
||||||
if self.overviewModule.getIsAllAccounts():
|
if self.overviewModule.getIsAllAccounts():
|
||||||
self.view.filterChanged("")
|
self.view.filterChanged("")
|
||||||
|
@ -271,7 +275,7 @@ method load*(self: Module) =
|
||||||
self.notifyFilterChanged()
|
self.notifyFilterChanged()
|
||||||
self.events.on(SIGNAL_WALLET_ACCOUNT_TOKENS_REBUILT) do(e:Args):
|
self.events.on(SIGNAL_WALLET_ACCOUNT_TOKENS_REBUILT) do(e:Args):
|
||||||
self.setTotalCurrencyBalance()
|
self.setTotalCurrencyBalance()
|
||||||
# self.notifyFilterChanged()
|
self.notifyModulesBalanceIsLoaded()
|
||||||
self.events.on(SIGNAL_TOKENS_PRICES_UPDATED) do(e:Args):
|
self.events.on(SIGNAL_TOKENS_PRICES_UPDATED) do(e:Args):
|
||||||
self.setTotalCurrencyBalance()
|
self.setTotalCurrencyBalance()
|
||||||
self.notifyFilterChanged()
|
self.notifyFilterChanged()
|
||||||
|
|
|
@ -66,8 +66,13 @@ proc getWalletAccoutColors(self: Module, walletAccounts: seq[WalletAccountDto])
|
||||||
|
|
||||||
method filterChanged*(self: Module, addresses: seq[string], chainIds: seq[int]) =
|
method filterChanged*(self: Module, addresses: seq[string], chainIds: seq[int]) =
|
||||||
let walletAccounts = self.controller.getWalletAccountsByAddresses(addresses)
|
let walletAccounts = self.controller.getWalletAccountsByAddresses(addresses)
|
||||||
let walletAccount = walletAccounts[0]
|
if walletAccounts.len == 0:
|
||||||
let loading = walletAccounts[0].assetsLoading or self.controller.getTokensMarketValuesLoading()
|
return
|
||||||
|
var loading = self.controller.getTokensMarketValuesLoading()
|
||||||
|
for account in walletAccounts:
|
||||||
|
if account.assetsLoading:
|
||||||
|
loading = true
|
||||||
|
break
|
||||||
if self.isAllAccounts:
|
if self.isAllAccounts:
|
||||||
let item = initItem(
|
let item = initItem(
|
||||||
"",
|
"",
|
||||||
|
@ -82,6 +87,7 @@ method filterChanged*(self: Module, addresses: seq[string], chainIds: seq[int])
|
||||||
)
|
)
|
||||||
self.view.setData(item)
|
self.view.setData(item)
|
||||||
else:
|
else:
|
||||||
|
let walletAccount = walletAccounts[0]
|
||||||
let isWatchOnlyAccount = walletAccount.walletType == "watch"
|
let isWatchOnlyAccount = walletAccount.walletType == "watch"
|
||||||
let item = initItem(
|
let item = initItem(
|
||||||
walletAccount.name,
|
walletAccount.name,
|
||||||
|
|
Loading…
Reference in New Issue