fix: download success toast showing up even if download errors (#1018)
This commit is contained in:
@@ -34,7 +34,7 @@ export class FilesState {
|
||||
|
||||
const decryptedBytesArray: Uint8Array[] = []
|
||||
|
||||
await this.application.files.downloadFile(file, async (decryptedBytes, progress) => {
|
||||
const result = await this.application.files.downloadFile(file, async (decryptedBytes, progress) => {
|
||||
if (isUsingStreamingSaver) {
|
||||
await saver.pushBytes(decryptedBytes)
|
||||
} else {
|
||||
@@ -51,6 +51,10 @@ export class FilesState {
|
||||
}
|
||||
})
|
||||
|
||||
if (result instanceof ClientDisplayableError) {
|
||||
throw new Error(result.text)
|
||||
}
|
||||
|
||||
if (isUsingStreamingSaver) {
|
||||
await saver.finish()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user