Skip to content

Commit

Permalink
fix: "Cannot connect to store node" banner never disappears
Browse files Browse the repository at this point in the history
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
  • Loading branch information
caybro authored and jrainville committed Jan 30, 2023
1 parent fbd936d commit 3c4d972
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/app/modules/main/controller.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();

Expand All @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 3c4d972

Please sign in to comment.