refactor
This commit is contained in:
@@ -102,12 +102,11 @@ export function useScreenRecorder({
|
|||||||
window.electronScreen.startRecordingWindow();
|
window.electronScreen.startRecordingWindow();
|
||||||
|
|
||||||
// Listen for stop from floating window
|
// Listen for stop from floating window
|
||||||
const cleanup = window.electronScreen.onStopRequested(() => {
|
cleanupIpcRef.current = window.electronScreen.onStopRequested(() => {
|
||||||
if (recorderRef.current?.state === "recording") {
|
if (recorderRef.current?.state === "recording") {
|
||||||
recorderRef.current.stop();
|
recorderRef.current.stop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cleanupIpcRef.current = cleanup;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
stopAllTracks();
|
stopAllTracks();
|
||||||
window.electronScreen.stopRecordingWindow();
|
window.electronScreen.stopRecordingWindow();
|
||||||
|
|||||||
Reference in New Issue
Block a user