diff --git a/src/electron/providers/storage/localFileSystem.ts b/src/electron/providers/storage/localFileSystem.ts index f584edb052..00af14d837 100644 --- a/src/electron/providers/storage/localFileSystem.ts +++ b/src/electron/providers/storage/localFileSystem.ts @@ -98,10 +98,10 @@ export default class LocalFileSystem implements IStorageProvider { console.log(`Listing files from ${normalizedPath}`); const files = await this.listItems(normalizedPath, (stats) => !stats.isDirectory()); const directories = await this.listItems(normalizedPath, (stats) => stats.isDirectory()); - await directories.forEachAsync(async (directory) => { + await Promise.all(directories.map(async (directory) => { const directoryFiles = await this.listFiles(directory); directoryFiles.forEach((file) => files.push(file)); - }); + })); return files; }