Skip to content

The swiss army knife of lossless video/audio editing

Remove deleted files from batch (#861)

Michael Yaworski3db3241ccd65
diff --git a/src/App.jsx b/src/App.jsx
index 788fecce..685c6e15 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -959,6 +959,8 @@ const App = memo(() => {
setBatchFiles([]);
}, [askBeforeClose]);
+ const removeBatchFile = useCallback((path) => setBatchFiles((existingBatch) => existingBatch.filter((existingFile) => existingFile.path !== path)), []);
+
const cleanupFiles = useCallback(async () => {
// Because we will reset state before deleting files
const saved = { previewFilePath, filePath, edlFilePath };
@@ -978,6 +980,8 @@ const App = memo(() => {
if (workingRef.current) return;
+ removeBatchFile(saved.filePath);
+
try {
setWorking(i18n.t('Cleaning up'));
@@ -1008,7 +1012,7 @@ const App = memo(() => {
} finally {
setWorking();
}
- }, [filePath, previewFilePath, closeFile, edlFilePath, cleanupChoices, setWorking]);
+ }, [previewFilePath, filePath, edlFilePath, closeFile, cleanupChoices, removeBatchFile, setWorking]);
const outSegments = useMemo(() => (invertCutSegments ? inverseCutSegments : apparentCutSegments),
[invertCutSegments, inverseCutSegments, apparentCutSegments]);