diff --git a/src/app/modules/main/wallet_section/module.nim b/src/app/modules/main/wallet_section/module.nim index b8827fffc7..fe432ff3e4 100644 --- a/src/app/modules/main/wallet_section/module.nim +++ b/src/app/modules/main/wallet_section/module.nim @@ -125,6 +125,7 @@ method notifyFilterChanged(self: Module) = self.assetsModule.filterChanged(self.filter.addresses, self.filter.chainIds) self.collectiblesModule.filterChanged(self.filter.addresses, self.filter.chainIds) self.transactionsModule.filterChanged(self.filter.addresses, self.filter.chainIds) + self.sendModule.filterChanged(self.filter.addresses, self.filter.chainIds) method getCurrencyAmount*(self: Module, amount: float64, symbol: string): CurrencyAmount = return self.controller.getCurrencyAmount(amount, symbol) diff --git a/src/app/modules/main/wallet_section/send/io_interface.nim b/src/app/modules/main/wallet_section/send/io_interface.nim index c58ac36797..317e35d153 100644 --- a/src/app/modules/main/wallet_section/send/io_interface.nim +++ b/src/app/modules/main/wallet_section/send/io_interface.nim @@ -57,11 +57,11 @@ method authenticateUser*(self: AccessInterface) {.base.} = method onUserAuthenticated*(self: AccessInterface, pin: string, password: string, keyUid: string) {.base.} = raise newException(ValueError, "No implementation available") -method switchAccount*(self: AccessInterface, accountIndex: int) = - raise newException(ValueError, "No implementation available") - method setSelectedSenderAccountIndex*(self: AccessInterface, index: int) = raise newException(ValueError, "No implementation available") method setSelectedReceiveAccountIndex*(self: AccessInterface, index: int) = raise newException(ValueError, "No implementation available") + +method filterChanged*(self: AccessInterface, addresses: seq[string], chainIds: seq[int]) = + raise newException(ValueError, "No implementation available") diff --git a/src/app/modules/main/wallet_section/send/module.nim b/src/app/modules/main/wallet_section/send/module.nim index 847832009a..2001cd2889 100644 --- a/src/app/modules/main/wallet_section/send/module.nim +++ b/src/app/modules/main/wallet_section/send/module.nim @@ -195,11 +195,11 @@ method suggestedRoutesReady*(self: Module, suggestedRoutes: string) = method getEstimatedTime*(self: Module, chainId: int, maxFeePerGas: string): int = return self.controller.getEstimatedTime(chainId, maxFeePerGas).int -method switchAccount*(self: Module, accountIndex: int) = - var walletAccount = self.controller.getWalletAccountByIndex(accountIndex) - if not walletAccount.isNil: - self.view.switchSenderAccountByAddress(walletAccount.address) - self.view.switchReceiveAccount(accountIndex) +method filterChanged*(self: Module, addresses: seq[string], chainIds: seq[int]) = + if addresses.len == 0: + return + self.view.switchSenderAccountByAddress(addresses[0]) + self.view.switchReceiveAccountByAddress(addresses[0]) method setSelectedSenderAccountIndex*(self: Module, index: int) = self.senderCurrentAccountIndex = index diff --git a/src/app/modules/main/wallet_section/send/view.nim b/src/app/modules/main/wallet_section/send/view.nim index c53908a131..aa1cb1b740 100644 --- a/src/app/modules/main/wallet_section/send/view.nim +++ b/src/app/modules/main/wallet_section/send/view.nim @@ -154,6 +154,11 @@ QtObject: self.setSelectedSenderAccount(account) self.delegate.setSelectedSenderAccountIndex(index) + proc switchReceiveAccountByAddress*(self: View, address: string) = + let (account, index) = self.accounts.getItemByAddress(address) + self.setSelectetReceiveAccount(account) + self.delegate.setSelectedReceiveAccountIndex(index) + proc switchSenderAccount*(self: View, index: int) {.slot.} = self.setSelectedSenderAccount(self.senderAccounts.getItemByIndex(index)) self.delegate.setSelectedSenderAccountIndex(index)