fix(desktop): Fixed issue on Mac desktop app where multiple files could not be downloaded
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
|||||||
FileItem,
|
FileItem,
|
||||||
InternalEventBus,
|
InternalEventBus,
|
||||||
isFile,
|
isFile,
|
||||||
|
Platform,
|
||||||
} from '@standardnotes/snjs'
|
} from '@standardnotes/snjs'
|
||||||
import { addToast, dismissToast, ToastType, updateToast } from '@standardnotes/toast'
|
import { addToast, dismissToast, ToastType, updateToast } from '@standardnotes/toast'
|
||||||
import { action, makeObservable, observable, reaction } from 'mobx'
|
import { action, makeObservable, observable, reaction } from 'mobx'
|
||||||
@@ -498,6 +499,18 @@ export class FilesController extends AbstractViewController<FilesControllerEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
downloadFiles = async (files: FileItem[]) => {
|
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(
|
await Promise.all(
|
||||||
files.map((file) =>
|
files.map((file) =>
|
||||||
this.handleFileAction({
|
this.handleFileAction({
|
||||||
|
|||||||
Reference in New Issue
Block a user