diff --git a/js/src/features/compose/use-screen-recorder.ts b/js/src/features/compose/use-screen-recorder.ts index 52b1de1..40f4a1a 100644 --- a/js/src/features/compose/use-screen-recorder.ts +++ b/js/src/features/compose/use-screen-recorder.ts @@ -102,12 +102,11 @@ export function useScreenRecorder({ window.electronScreen.startRecordingWindow(); // Listen for stop from floating window - const cleanup = window.electronScreen.onStopRequested(() => { + cleanupIpcRef.current = window.electronScreen.onStopRequested(() => { if (recorderRef.current?.state === "recording") { recorderRef.current.stop(); } }); - cleanupIpcRef.current = cleanup; } catch (err) { stopAllTracks(); window.electronScreen.stopRecordingWindow();