chore: fix issue with downloading multiple files on macOS
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/files": "workspace:*",
|
||||
"@standardnotes/utils": "workspace:*",
|
||||
"@types/wicg-file-system-access": "^2020.9.5",
|
||||
"@types/wicg-file-system-access": "^2023.10.4",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,12 +22,14 @@ export class StreamingFileSaver {
|
||||
}
|
||||
|
||||
/** This function must be called in response to a user interaction, otherwise, it will be rejected by the browser. */
|
||||
async selectFileToSaveTo(): Promise<void> {
|
||||
async selectFileToSaveTo(handle?: FileSystemFileHandle): Promise<void> {
|
||||
this.log('Showing save file picker')
|
||||
|
||||
const downloadHandle = await window.showSaveFilePicker({
|
||||
suggestedName: this.name,
|
||||
})
|
||||
const downloadHandle = handle
|
||||
? handle
|
||||
: await window.showSaveFilePicker({
|
||||
suggestedName: this.name,
|
||||
})
|
||||
|
||||
this.writableStream = await downloadHandle.createWritable()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user