Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent disconnected from daemon notification on suspend
Browse files Browse the repository at this point in the history
raksooo committed Apr 2, 2024
1 parent ba779e9 commit 7a8051b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gui/src/main/index.ts
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit 7a8051b

Please sign in to comment.