From 77378cd5f3827c23e83806c26edee455b2d756b8 Mon Sep 17 00:00:00 2001 From: Sandeep Karmata Date: Fri, 22 May 2026 23:51:02 +0530 Subject: [PATCH 1/3] Fix premature state update in TrimControl --- src/components/TrimControl.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/TrimControl.tsx b/src/components/TrimControl.tsx index efe6bf47..95d0baa6 100644 --- a/src/components/TrimControl.tsx +++ b/src/components/TrimControl.tsx @@ -82,8 +82,6 @@ export default function TrimControl({ recipe, onChange, duration, file }: Props) const n = parseFloat(val); - onChange({ trimEnd: n }); - if (isNaN(n)) { setEnd(true); setEndErrorMsg("Enter a valid number."); @@ -112,6 +110,7 @@ export default function TrimControl({ recipe, onChange, duration, file }: Props) setEnd(false); setEndErrorMsg(""); + onChange({ trimEnd: n }); }; const inputClass = From 552742b02deef8ba1ef50e17a31743768db6d99c Mon Sep 17 00:00:00 2001 From: Sandeep Karmata Date: Fri, 22 May 2026 23:58:56 +0530 Subject: [PATCH 2/3] Trigger CI recheck From f74a76c67d0e916c4d26e9045d8f47b2c53dd492 Mon Sep 17 00:00:00 2001 From: Sandeep Karmata Date: Sat, 23 May 2026 00:00:47 +0530 Subject: [PATCH 3/3] Fix unexportable video bug for unknown durations --- src/hooks/useVideoEditor.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hooks/useVideoEditor.ts b/src/hooks/useVideoEditor.ts index d894ed07..13a16e86 100644 --- a/src/hooks/useVideoEditor.ts +++ b/src/hooks/useVideoEditor.ts @@ -70,11 +70,13 @@ function validateRecipe(recipe: EditRecipe, duration: number ): string | null { "Trim start time cannot be less than 0 seconds.", ], [ - recipe.trimEnd !== null && recipe.trimEnd > duration, + recipe.trimEnd !== null && duration > 0 && recipe.trimEnd > duration, `Trim end time cannot exceed the video duration (${Math.floor(duration)}s).`, ], [ - recipe.trimStart >= (recipe.trimEnd ?? duration), + recipe.trimEnd !== null + ? recipe.trimStart >= recipe.trimEnd + : (duration > 0 && recipe.trimStart >= duration), "Trim start time must be earlier than the end time.", ], [