From 61b217c5eb8a15cb012d426d429afd42320dc4dc Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Mon, 11 Sep 2023 11:20:50 +0200 Subject: [PATCH] fix(@desktop/wallet): the app crashes when receives "show/hide watch only" value from paired device Fixes: #12115 --- .../modules/main/profile_section/wallet/accounts/module.nim | 3 ++- src/app_service/service/settings/service.nim | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/modules/main/profile_section/wallet/accounts/module.nim b/src/app/modules/main/profile_section/wallet/accounts/module.nim index 8f32a38b25..68ea77eda3 100644 --- a/src/app/modules/main/profile_section/wallet/accounts/module.nim +++ b/src/app/modules/main/profile_section/wallet/accounts/module.nim @@ -180,7 +180,8 @@ method load*(self: Module) = self.refreshWalletAccounts() self.events.on(SIGNAL_INCLUDE_WATCH_ONLY_ACCOUNTS_UPDATED) do(e: Args): - self.view.setIncludeWatchOnlyAccount(self.controller.isIncludeWatchOnlyAccount()) + let args = SettingsBoolValueArgs(e) + self.view.setIncludeWatchOnlyAccount(args.value) self.events.on(SIGNAL_WALLET_ACCOUNT_PREFERRED_SHARING_CHAINS_UPDATED) do(e: Args): let args = AccountArgs(e) diff --git a/src/app_service/service/settings/service.nim b/src/app_service/service/settings/service.nim index 03e8f401ed..736b45c787 100644 --- a/src/app_service/service/settings/service.nim +++ b/src/app_service/service/settings/service.nim @@ -116,7 +116,7 @@ QtObject: self.events.emit(SIGNAL_MNEMONIC_REMOVED, Args()) if settingsField.name == INCLUDE_WATCH_ONLY_ACCOUNT: self.settings.includeWatchOnlyAccount = settingsField.value.getBool - self.events.emit(SIGNAL_INCLUDE_WATCH_ONLY_ACCOUNTS_UPDATED, Args()) + self.events.emit(SIGNAL_INCLUDE_WATCH_ONLY_ACCOUNTS_UPDATED, SettingsBoolValueArgs(value: self.settings.includeWatchOnlyAccount)) if settingsField.name == PROFILE_MIGRATION_NEEDED: self.settings.profileMigrationNeeded = settingsField.value.getBool self.events.emit(SIGNAL_PROFILE_MIGRATION_NEEDED_UPDATED, SettingsBoolValueArgs(value: self.settings.profileMigrationNeeded))