Create polished demo videos without editing skills. Mac/Windows/Linux
fix(recording): always clean up failed starts
wiiiii1230f1e04a5471b
diff --git a/src/hooks/useScreenRecorder.ts b/src/hooks/useScreenRecorder.tsindex 20c178db..daf88c0f 100644--- a/src/hooks/useScreenRecorder.ts+++ b/src/hooks/useScreenRecorder.ts@@ -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);