From 3c4d97248e04079d6785e82d44fa9876036f3fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Mon, 30 Jan 2023 14:31:20 +0100 Subject: [PATCH] fix: "Cannot connect to store node" banner never disappears connect to the correct signal the store node (aka mailserver) is no longer a dialog that would let the user select a new available mailserver; we care about a working and _active_ mailserver here Fixes #9358 --- src/app/modules/main/controller.nim | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/modules/main/controller.nim b/src/app/modules/main/controller.nim index fdd6b7d231..32fa81efb9 100644 --- a/src/app/modules/main/controller.nim +++ b/src/app/modules/main/controller.nim @@ -89,11 +89,14 @@ proc init*(self: Controller) = if self.accountsService.isFirstTimeAccountLogin(): let d9 = 9*86400 # 9 days discard self.settingsService.setDefaultSyncPeriod(d9) - - self.events.on(SIGNAL_MAILSERVER_AVAILABLE) do(e:Args): + + self.events.on(SIGNAL_ACTIVE_MAILSERVER_CHANGED) do(e:Args): + let args = ActiveMailserverChangedArgs(e) + if args.nodeAddress == "": + return self.delegate.emitMailserverWorking() - echo "MAILSERVER AVAILABLE: ", repr(e) - # We need to take some actions here. This is the only pace where "mailserverAvailable" signal should be handled. + echo "ACTIVE MAILSERVER CHANGED: ", repr(e) + # We need to take some actions here. This is the only place where "activeMailserverChanged" signal should be handled. # Do the following, if we really need that. # requestAllHistoricMessagesResult # requestMissingCommunityInfos @@ -266,7 +269,7 @@ proc init*(self: Controller) = self.events.on(chat_service.SIGNAL_CHAT_LEFT) do(e: Args): let args = chat_service.ChatArgs(e) self.delegate.onChatLeft(args.chatId) - + self.events.on(SIGNAL_COMMUNITY_MY_REQUEST_ADDED) do(e: Args): self.delegate.onMyRequestAdded(); @@ -276,7 +279,7 @@ proc init*(self: Controller) = self.delegate.onSharedKeycarModuleKeycardSyncPurposeTerminated(args.lastStepInTheCurrentFlow) self.events.emit(SIGNAL_SHARED_KEYCARD_MODULE_KEYCARD_SYNC_TERMINATED, Args()) return - if args.uniqueIdentifier != UNIQUE_MAIN_MODULE_IDENTIFIER or + if args.uniqueIdentifier != UNIQUE_MAIN_MODULE_IDENTIFIER or self.authenticateUserFlowRequestedBy.len == 0: return self.delegate.onSharedKeycarModuleFlowTerminated(args.lastStepInTheCurrentFlow) @@ -289,7 +292,7 @@ proc init*(self: Controller) = self.events.on(SIGNAL_SHARED_KEYCARD_MODULE_DISPLAY_POPUP) do(e: Args): let args = SharedKeycarModuleBaseArgs(e) - if args.uniqueIdentifier != UNIQUE_MAIN_MODULE_IDENTIFIER or + if args.uniqueIdentifier != UNIQUE_MAIN_MODULE_IDENTIFIER or self.authenticateUserFlowRequestedBy.len == 0: return self.delegate.onDisplayKeycardSharedModuleFlow()