mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
web: fix bulk exists check for files
This commit is contained in:
committed by
Abdullah Atta
parent
dbc907ceeb
commit
02fdec74ce
@@ -576,9 +576,10 @@ async function exists(filename: string | FileHandle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function bulkExists(filenames: string[]) {
|
async function bulkExists(filenames: string[]) {
|
||||||
return Array.from(
|
const files = (await streamablefs.list()).map((c) =>
|
||||||
new Set(filenames).difference(new Set(await streamablefs.list())).values()
|
c.replace(/-chunk-\d+/, "")
|
||||||
);
|
);
|
||||||
|
return Array.from(new Set(filenames).difference(new Set(files)).values());
|
||||||
}
|
}
|
||||||
|
|
||||||
type FileMetadata = {
|
type FileMetadata = {
|
||||||
|
|||||||
Reference in New Issue
Block a user