mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-23 04:50:28 +00:00
fix(@wallet): fix all accounts balance
in case we add a new account the balance needs to be based on all accounts all the time fixes #11103
This commit is contained in:
parent
10e5c714a2
commit
d534bf6773
@ -1,4 +1,4 @@
|
||||
import NimQml, chronicles
|
||||
import NimQml, chronicles, sequtils, sugar
|
||||
|
||||
import ./controller, ./view, ./filter
|
||||
import ./io_interface as io_interface
|
||||
@ -130,7 +130,14 @@ method getCurrentCurrency*(self: Module): string =
|
||||
self.controller.getCurrency()
|
||||
|
||||
method setTotalCurrencyBalance*(self: Module) =
|
||||
self.view.setTotalCurrencyBalance(self.controller.getCurrencyBalance(self.filter.addresses))
|
||||
var addresses: seq[string] = @[]
|
||||
let walletAccounts = self.controller.getWalletAccounts()
|
||||
if self.filter.excludeWatchOnly:
|
||||
addresses = walletAccounts.filter(a => a.walletType != "watch").map(a => a.address)
|
||||
else:
|
||||
addresses = walletAccounts.map(a => a.address)
|
||||
|
||||
self.view.setTotalCurrencyBalance(self.controller.getCurrencyBalance(addresses))
|
||||
|
||||
method notifyFilterChanged(self: Module) =
|
||||
self.overviewModule.filterChanged(self.filter.addresses, self.filter.chainIds, self.filter.excludeWatchOnly, self.filter.allAddresses)
|
||||
|
Loading…
x
Reference in New Issue
Block a user