1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-25 11:43:17 +01:00
This commit is contained in:
Mikael Finstad 2024-03-21 23:28:30 +08:00
parent f677619039
commit 26b4dc13c2
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -1850,7 +1850,7 @@ function App() {
if (append) { if (append) {
const newUniquePaths = newPaths.filter((newPath) => !existingFiles.some(({ path: existingPath }) => newPath === existingPath)); const newUniquePaths = newPaths.filter((newPath) => !existingFiles.some(({ path: existingPath }) => newPath === existingPath));
const [firstNewUniquePath] = newUniquePaths; const [firstNewUniquePath] = newUniquePaths;
if (firstNewUniquePath == null) throw new Error(); if (firstNewUniquePath == null) return existingFiles;
setSelectedBatchFiles([firstNewUniquePath]); setSelectedBatchFiles([firstNewUniquePath]);
return [...existingFiles, ...mapPathsToFiles(newUniquePaths)]; return [...existingFiles, ...mapPathsToFiles(newUniquePaths)];
} }
@ -2391,10 +2391,10 @@ function App() {
key, key,
async (_event: unknown, ...args: unknown[]) => actionWithCatch(() => fn(...args)), async (_event: unknown, ...args: unknown[]) => actionWithCatch(() => fn(...args)),
] as const), ] as const),
// all main actions (no arguments, except keyup which we don't support): // all main actions (no arguments, so simulate keyup):
...Object.entries(mainActions).map(([key, fn]) => [ ...Object.entries(mainActions).map(([key, fn]) => [
key, key,
async () => actionWithCatch(() => fn({ keyup: false })), async () => actionWithCatch(() => fn({ keyup: true })),
] as const), ] as const),
]; ];