From 3eb75b8a0454877e2eb3a159d1719ab0a86077e0 Mon Sep 17 00:00:00 2001 From: Rambilas Sah Date: Tue, 19 May 2026 21:41:37 +0530 Subject: [PATCH] fix: ensure native beforeunload warning triggers correctly during video export --- src/hooks/useVideoEditor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useVideoEditor.ts b/src/hooks/useVideoEditor.ts index a2283128..7ddbd9e8 100644 --- a/src/hooks/useVideoEditor.ts +++ b/src/hooks/useVideoEditor.ts @@ -348,13 +348,13 @@ export function useVideoEditor() { useEffect(() => { const shouldWarn = status === "exporting" || - status === "loading-engine" || - status === "done"; + status === "loading-engine"; if (!shouldWarn) return; const handler = (e: BeforeUnloadEvent) => { e.preventDefault(); + e.returnValue = ""; }; window.addEventListener("beforeunload", handler);