fix(@wallet): delete selected account
This commit is contained in:
parent
c94997ddec
commit
bdaf122ec7
|
@ -95,9 +95,11 @@ proc setBalance(self: Module, tokens: seq[WalletTokenDto]) =
|
||||||
|
|
||||||
# TODO(alaibe): replace with filter logic
|
# TODO(alaibe): replace with filter logic
|
||||||
method switchAccount*(self: Module, accountIndex: int) =
|
method switchAccount*(self: Module, accountIndex: int) =
|
||||||
|
var walletAccount = self.controller.getWalletAccount(accountIndex)
|
||||||
self.currentAccountIndex = accountIndex
|
self.currentAccountIndex = accountIndex
|
||||||
|
if walletAccount.isNil:
|
||||||
let walletAccount = self.controller.getWalletAccount(accountIndex)
|
self.currentAccountIndex = 0
|
||||||
|
walletAccount = self.controller.getWalletAccount(self.currentAccountIndex)
|
||||||
|
|
||||||
let item = initItem(
|
let item = initItem(
|
||||||
walletAccount.name,
|
walletAccount.name,
|
||||||
|
@ -134,3 +136,4 @@ proc onAccountAdded(self: Module, account: WalletAccountDto) =
|
||||||
|
|
||||||
proc onAccountRemoved(self: Module, account: WalletAccountDto) =
|
proc onAccountRemoved(self: Module, account: WalletAccountDto) =
|
||||||
self.switchAccount(self.currentAccountIndex)
|
self.switchAccount(self.currentAccountIndex)
|
||||||
|
|
Loading…
Reference in New Issue