fix(wallet): Refresh receiver preferred chain ids (#15712)
This commit is contained in:
parent
2175311c86
commit
30b88377c2
|
@ -152,3 +152,15 @@ QtObject:
|
|||
if cmpIgnoreCase(item.address(), address) == 0 and item.walletType != "watch":
|
||||
return true
|
||||
return false
|
||||
|
||||
proc onPreferredSharingChainsUpdated*(self: Model, address, prodPreferredChainIds, testPreferredChainIds: string) =
|
||||
var i = 0
|
||||
for item in self.items.mitems:
|
||||
if address == item.address:
|
||||
item.prodPreferredChainIds = prodPreferredChainIds
|
||||
item.testPreferredChainIds = testPreferredChainIds
|
||||
let index = self.createIndex(i, 0, nil)
|
||||
defer: index.delete
|
||||
self.dataChanged(index, index, @[ModelRole.PreferredSharingChainIds.int])
|
||||
break
|
||||
i.inc
|
|
@ -70,6 +70,10 @@ method load*(self: Module) =
|
|||
self.controller.init()
|
||||
self.view.load()
|
||||
|
||||
self.events.on(SIGNAL_WALLET_ACCOUNT_PREFERRED_SHARING_CHAINS_UPDATED) do(e: Args):
|
||||
let args = AccountArgs(e)
|
||||
self.view.onPreferredSharingChainsUpdated(args.account.keyUid, args.account.address, args.account.prodPreferredChainIds, args.account.testPreferredChainIds)
|
||||
|
||||
method isLoaded*(self: Module): bool =
|
||||
return self.moduleLoaded
|
||||
|
||||
|
|
|
@ -68,4 +68,7 @@ QtObject:
|
|||
self.delegate.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance)
|
||||
|
||||
proc getWalletAccountAsJson*(self: View, address: string): string {.slot.} =
|
||||
return $self.delegate.getWalletAccountAsJson(address)
|
||||
return $self.delegate.getWalletAccountAsJson(address)
|
||||
|
||||
proc onPreferredSharingChainsUpdated*(self: View, keyUid, address, prodPreferredChainIds, testPreferredChainIds: string) =
|
||||
self.accounts.onPreferredSharingChainsUpdated(address, prodPreferredChainIds, testPreferredChainIds)
|
Loading…
Reference in New Issue