kopia lustrzana https://github.com/mifi/lossless-cut
Remove deleted files from batch (#861)
* Remove deleted files from batch * improve a bit Co-authored-by: Mikael Finstad <finstaden@gmail.com>pull/840/head^2
rodzic
3e6a8791b9
commit
3db3241ccd
|
@ -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]);
|
||||
|
|
Ładowanie…
Reference in New Issue