Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent disconnected from daemon notification on suspend #6048

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gui/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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,
Expand Down
Loading