From cd23320f92d2bb2288375d136525b730ce22dd42 Mon Sep 17 00:00:00 2001 From: Sivert <316918682+grytchat@users.noreply.github.com> Date: Wed, 11 Nov 2026 17:49:14 +0100 Subject: [PATCH] fix(desktop): minimize to tray works without an account The close handler only hid the window to the tray when the renderer had said someone was signed in. With Local Identity nobody signs in, so "Minimize to tray on close" quit the app instead. The check is gone, and so is the signed-in flag and its IPC, which nothing else used. GRYT-2077 Co-Authored-By: Claude Opus 5.5 --- electron/main.ts | 15 +-------------- electron/preload.ts | 4 ---- src/lib/electron.ts | 1 - src/packages/common/src/hooks/useAccount.tsx | 6 ------ 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/electron/main.ts b/electron/main.ts index c5a993b3b..8c8b10418 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -578,7 +578,6 @@ let voiceState: VoiceState = { serverName: null, }; -let isUserSignedIn = false; let uiohookRunning = false; let startHiddenOnLaunch = false; let localServer: Server | null = null; @@ -2292,11 +2291,7 @@ function createMainWindow(): BrowserWindow { ); mainWindow.on("close", (event) => { - if ( - !isQuitting && - closeToTray && - isUserSignedIn - ) { + if (!isQuitting && closeToTray) { event.preventDefault(); mainWindow?.hide(); } @@ -3418,14 +3413,6 @@ if (!gotSingleInstanceLock) { } ); - ipcMain.on( - "set-signed-in", - (_event, signedIn: boolean) => { - isUserSignedIn = - signedIn; - } - ); - ipcMain.on( "set-voice-state", (_event, next: VoiceState) => { diff --git a/electron/preload.ts b/electron/preload.ts index ed3becb18..a7b48bb13 100644 --- a/electron/preload.ts +++ b/electron/preload.ts @@ -262,10 +262,6 @@ contextBridge.exposeInMainWorld("electronAPI", { ipcRenderer.send("set-close-to-tray", enabled); }, - setSignedIn(signedIn: boolean) { - ipcRenderer.send("set-signed-in", signedIn); - }, - setVoiceState(state: { inVoice: boolean; muted: boolean; diff --git a/src/lib/electron.ts b/src/lib/electron.ts index 3e26056dd..8d957773b 100644 --- a/src/lib/electron.ts +++ b/src/lib/electron.ts @@ -295,7 +295,6 @@ export interface ElectronAPI { getCloseToTray(): Promise; setCloseToTray(enabled: boolean): void; - setSignedIn(signedIn: boolean): void; /** * Tell the tray what voice is doing. The main process has no other route: mute * and deafen are renderer settings and the SFU connection is a renderer concern. diff --git a/src/packages/common/src/hooks/useAccount.tsx b/src/packages/common/src/hooks/useAccount.tsx index 9f8ace03e..0abf8bbc9 100644 --- a/src/packages/common/src/hooks/useAccount.tsx +++ b/src/packages/common/src/hooks/useAccount.tsx @@ -57,12 +57,6 @@ function useAccountHook(): Account { /* Set once the retry has its answer or somebody signs out, so it never starts twice. */ const retryDone = useRef(false); - useEffect(() => { - if (isSignedIn == null) return; - const api = getElectronAPI(); - api?.setSignedIn(isSignedIn); - }, [isSignedIn]); - // Wire up the Electron deep-link listener useEffect(() => { if (!isElectron()) return;