From f1fa32d0fb1e932a22492586ffc3f9b387f22153 Mon Sep 17 00:00:00 2001 From: Oskar Nyberg Date: Tue, 2 Apr 2024 11:04:21 +0200 Subject: [PATCH] Prevent disconnected from daemon notification on suspend --- gui/src/main/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 59f81141cdf8..a84465538883 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -470,7 +470,7 @@ class ApplicationMain const wasConnected = this.daemonRpc.isConnected; IpcMainEventChannel.navigation.notifyReset?.(); this.daemonRpc.disconnect(); - this.onDaemonDisconnected(wasConnected); + this.onDaemonDisconnected(wasConnected, undefined, true); }; private onResume = () => { @@ -620,7 +620,7 @@ class ApplicationMain } }; - private onDaemonDisconnected = (wasConnected: boolean, error?: Error) => { + private onDaemonDisconnected = (wasConnected: boolean, error?: Error, planned?: boolean) => { if (this.daemonEventListener) { this.daemonRpc.unsubscribeDaemonEventListener(this.daemonEventListener); } @@ -631,7 +631,7 @@ class ApplicationMain SystemNotificationCategory.tunnelState, ); - if (this.tunnelState.tunnelState.state !== 'disconnected') { + if (this.tunnelState.tunnelState.state !== 'disconnected' && !planned) { this.notificationController.notifyDaemonDisconnected( this.userInterface?.isWindowVisible() ?? false, this.settings.gui.enableSystemNotifications,