From e2e9f75e404f13fb8d0e0aefa41ff4980eedeecc Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sat, 12 Sep 2026 20:28:41 -0400 Subject: [PATCH] fix(desktop): release keep-awake on unmount Fixes #76 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA --- src/app/hooks/useTauriCallPower.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/hooks/useTauriCallPower.ts b/src/app/hooks/useTauriCallPower.ts index 9d3f4e860..479769045 100644 --- a/src/app/hooks/useTauriCallPower.ts +++ b/src/app/hooks/useTauriCallPower.ts @@ -14,5 +14,11 @@ export function useTauriCallPower(): void { const callEmbed = useAtomValue(callEmbedAtom); useEffect(() => { invokeTauri('set_call_active', { active: callEmbed !== undefined }); + // #76 — if the shell unmounts while a call is still active (forced + // reload/HMR, or a future teardown path that doesn't end the call first), + // release the native keep-awake state instead of leaving it held forever. + return () => { + invokeTauri('set_call_active', { active: false }); + }; }, [callEmbed]); }