refactor
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user