Skip to content

The swiss army knife of lossless video/audio editing

auto save disabled initial segment

Mikael Finstad2603017e8450
diff --git a/src/renderer/src/hooks/useSegmentsAutoSave.ts b/src/renderer/src/hooks/useSegmentsAutoSave.ts
index 3627e83e..e5cc4a2b 100644
--- a/src/renderer/src/hooks/useSegmentsAutoSave.ts
+++ b/src/renderer/src/hooks/useSegmentsAutoSave.ts
@@ -40,9 +40,13 @@ export default ({ autoSaveProjectFile, storeProjectInWorkingDir, filePath, custo
if (!autoSaveProjectFile
|| !debouncedSaveOperation
|| debouncedSaveOperation.filePath == null
- // Don't create llc file if no segments yet, or if initial segment:
+ // Don't create llc file if no segments yet
|| debouncedSaveOperation.cutSegments.length === 0
- || debouncedSaveOperation.cutSegments[0]?.initial) return;
+ // or if initial segment (and not deselected): https://github.com/mifi/lossless-cut/issues/2745#issuecomment-3979480707
+ || (debouncedSaveOperation.cutSegments[0]?.initial && debouncedSaveOperation.cutSegments[0].selected)
+ ) {
+ return;
+ }
if (lastSaveOperation.current && lastSaveOperation.current.projectFileSavePath === debouncedSaveOperation.projectFileSavePath && isEqual(mapSaveableSegments(lastSaveOperation.current.cutSegments), mapSaveableSegments(debouncedSaveOperation.cutSegments))) {
console.log('Segments unchanged, skipping save');