diff --git a/src/app/modules/main/wallet_section/all_collectibles/io_interface.nim b/src/app/modules/main/wallet_section/all_collectibles/io_interface.nim index e9cf684435..cfe5d94065 100644 --- a/src/app/modules/main/wallet_section/all_collectibles/io_interface.nim +++ b/src/app/modules/main/wallet_section/all_collectibles/io_interface.nim @@ -45,3 +45,6 @@ method getCollectibleGroupByCollection*(self: AccessInterface): bool {.base.} = method toggleCollectibleGroupByCollection*(self: AccessInterface): bool {.base.} = raise newException(ValueError, "No implementation available") + +method setSelectedAccount*(self: AccessInterface, address: string) {.base.} = + raise newException(ValueError, "No implementation available") \ No newline at end of file diff --git a/src/app/modules/main/wallet_section/all_collectibles/module.nim b/src/app/modules/main/wallet_section/all_collectibles/module.nim index 899d13c906..79885abe77 100644 --- a/src/app/modules/main/wallet_section/all_collectibles/module.nim +++ b/src/app/modules/main/wallet_section/all_collectibles/module.nim @@ -78,6 +78,9 @@ method viewDidLoad*(self: Module) = self.moduleLoaded = true self.delegate.allCollectiblesModuleDidLoad() +method setSelectedAccount*(self: Module, address: string) = + self.collectiblesController.setSelectedAccount(address) + method getAllCollectiblesModel*(self: Module): collectibles_model.Model = return self.collectiblesController.getModel() diff --git a/src/app/modules/main/wallet_section/module.nim b/src/app/modules/main/wallet_section/module.nim index 68fa09addd..cfede2f9f0 100644 --- a/src/app/modules/main/wallet_section/module.nim +++ b/src/app/modules/main/wallet_section/module.nim @@ -236,6 +236,7 @@ proc setKeypairOperabilityForObservedAccount(self: Module, address: string) = method setFilterAddress*(self: Module, address: string) = self.setKeypairOperabilityForObservedAccount(address) self.filter.setAddress(address) + self.allCollectiblesModule.setSelectedAccount(address) self.overviewModule.setIsAllAccounts(false) self.view.setAddressFilters(address) self.notifyFilterChanged() @@ -243,6 +244,7 @@ method setFilterAddress*(self: Module, address: string) = method setFilterAllAddresses*(self: Module) = self.view.setKeypairOperabilityForObservedAccount("") self.filter.setAddresses(self.getWalletAddressesNotHidden()) + self.allCollectiblesModule.setSelectedAccount("") self.view.setAddressFilters(self.filter.addresses.join(":")) self.overviewModule.setIsAllAccounts(true) self.notifyFilterChanged() diff --git a/src/app/modules/shared_modules/collectibles/controller.nim b/src/app/modules/shared_modules/collectibles/controller.nim index 9fe2ca0283..a123ea83b6 100644 --- a/src/app/modules/shared_modules/collectibles/controller.nim +++ b/src/app/modules/shared_modules/collectibles/controller.nim @@ -38,6 +38,7 @@ QtObject: addresses: seq[string] chainIds: seq[int] + selectedAddress: string filter: backend_collectibles.CollectibleFilter ownershipStatus: Table[string, Table[int, OwnershipStatus]] # Table[address][chainID] -> OwnershipStatus @@ -70,7 +71,7 @@ QtObject: # Otherwise, if any address+chainID is updating, then the whole model is updating # Otherwise, the model is idle for address, statusPerChainID in self.ownershipStatus.pairs: - if not self.addresses.contains(address): + if not self.addresses.contains(address) or (self.selectedAddress != "" and self.selectedAddress != address): continue for chainID, status in statusPerChainID: if not self.chainIds.contains(chainID): @@ -284,6 +285,10 @@ QtObject: signalConnect(result.model, "loadMoreItems()", result, "onModelLoadMoreItems()") + proc setSelectedAccount*(self: Controller, address: string) = + self.selectedAddress = address + self.checkModelState() + proc setFilterAddressesAndChains*(self: Controller, addresses: seq[string], chainIds: seq[int]) = if chainIds == self.chainIds and addresses == self.addresses: return