From 0c584f4b3510e2c1152ef0f2358978fde68c9ac8 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sat, 18 Apr 2020 19:33:56 +0800 Subject: [PATCH] Reset segments when last segment is deleted --- src/App.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index 5d53bb99..874125d8 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -711,7 +711,10 @@ const App = memo(() => { }, [copyAnyAudioTrack, filePath, mainStreams]); const removeCutSegment = useCallback(() => { - if (cutSegments.length < 2) return; + if (cutSegments.length <= 1) { + setCutSegments(createInitialCutSegments()); + return; + } const cutSegmentsNew = [...cutSegments]; cutSegmentsNew.splice(currentSegIndexSafe, 1);