fix(desktop): release keep-awake on unmount
Fixes #76 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
@@ -14,5 +14,11 @@ export function useTauriCallPower(): void {
|
|||||||
const callEmbed = useAtomValue(callEmbedAtom);
|
const callEmbed = useAtomValue(callEmbedAtom);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
invokeTauri('set_call_active', { active: callEmbed !== undefined });
|
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]);
|
}, [callEmbed]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user