mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-11-09 23:43:35 +00:00
fix(recording): always clean up failed starts
This commit is contained in:
1 parent
4207664c4a
commit
0f1e04a547
1 file changed
+8
-3
@@ -1300,9 +1300,14 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
|
||||
: "Failed to start recording",
|
||||
);
|
||||
setRecording(false);
|
||||
await window.electronAPI?.setRecordingState(false);
|
||||
cleanupCapturedMedia();
|
||||
await stopWebcamRecorder();
|
||||
try {
|
||||
await window.electronAPI?.setRecordingState(false);
|
||||
} catch (stateError) {
|
||||
console.warn("Failed to reset main-process recording state:", stateError);
|
||||
} finally {
|
||||
cleanupCapturedMedia();
|
||||
await stopWebcamRecorder();
|
||||
}
|
||||
} finally {
|
||||
startInFlight.current = false;
|
||||
setStarting(false);
|
||||
|
||||
Reference in new issue
Block a user