From 43ec6ee9cd74d921f5c12cfc43f0fa563862eb22 Mon Sep 17 00:00:00 2001 From: Ayush765-spec Date: Sat, 4 Apr 2026 11:51:05 +0530 Subject: [PATCH] fix(editor): localize new recording dialog and fix session clear behavior --- src/components/video-editor/VideoEditor.tsx | 24 +++++++++++---------- src/i18n/locales/en/editor.json | 6 ++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx index dae009a..26bfd44 100644 --- a/src/components/video-editor/VideoEditor.tsx +++ b/src/components/video-editor/VideoEditor.tsx @@ -474,10 +474,14 @@ export default function VideoEditor() { }, [saveProject]); const handleNewRecordingConfirm = useCallback(async () => { - setShowNewRecordingDialog(false); - await window.electronAPI.clearCurrentVideoPath(); - await window.electronAPI.setCurrentRecordingSession(null); - await window.electronAPI.switchToHud(); + try { + await window.electronAPI.clearCurrentVideoPath(); + await window.electronAPI.switchToHud(); + setShowNewRecordingDialog(false); + } catch (err) { + console.error("Failed to start new recording:", err); + setError("Failed to start new recording: " + String(err)); + } }, []); const handleLoadProject = useCallback(async () => { @@ -1415,10 +1419,8 @@ export default function VideoEditor() { style={{ WebkitAppRegion: "no-drag" } as React.CSSProperties} > - New Recording - - Start a new recording? Your current recording will be discarded. - + {t("newRecording.title")} + {t("newRecording.description")} @@ -1470,7 +1472,7 @@ export default function VideoEditor() { className="flex items-center gap-1 px-2 py-1 rounded-md text-white/50 hover:text-white/90 hover:bg-white/10 transition-all duration-150 text-[11px] font-medium" >