fix: open editor after recording fallback

This commit is contained in:
webadderall
2026-03-28 20:42:38 +11:00
parent 6463cdff58
commit 7085cc4ce9
+18 -8
View File
@@ -276,14 +276,24 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
}, []);
const finalizeRecordingSession = useCallback(async (videoPath: string, webcamPath: string | null) => {
if (webcamPath) {
await window.electronAPI.setCurrentRecordingSession({
videoPath,
webcamPath,
timeOffsetMs: webcamTimeOffsetMs.current,
});
} else {
await window.electronAPI.setCurrentVideoPath(videoPath);
try {
if (webcamPath) {
await window.electronAPI.setCurrentRecordingSession({
videoPath,
webcamPath,
timeOffsetMs: webcamTimeOffsetMs.current,
});
} else {
await window.electronAPI.setCurrentVideoPath(videoPath);
}
} catch (error) {
console.error("Failed to persist recording session metadata:", error);
try {
await window.electronAPI.setCurrentVideoPath(videoPath);
} catch (fallbackError) {
console.error("Failed to persist fallback video path:", fallbackError);
}
}
await window.electronAPI.switchToEditor();