fix(desktop): Fixed issue on Mac desktop app where multiple files could not be downloaded

This commit is contained in:
Aman Harwara
2023-04-27 20:46:18 +05:30
parent 7b6e5f95d5
commit 247ff62422

View File

@@ -23,6 +23,7 @@ import {
FileItem,
InternalEventBus,
isFile,
Platform,
} from '@standardnotes/snjs'
import { addToast, dismissToast, ToastType, updateToast } from '@standardnotes/toast'
import { action, makeObservable, observable, reaction } from 'mobx'
@@ -498,6 +499,18 @@ export class FilesController extends AbstractViewController<FilesControllerEvent
}
downloadFiles = async (files: FileItem[]) => {
if (this.application.platform === Platform.MacDesktop) {
for (const file of files) {
await this.handleFileAction({
type: FileItemActionType.DownloadFile,
payload: {
file,
},
})
}
return
}
await Promise.all(
files.map((file) =>
this.handleFileAction({