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[] = []
|
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) {
|
if (isUsingStreamingSaver) {
|
||||||
await saver.pushBytes(decryptedBytes)
|
await saver.pushBytes(decryptedBytes)
|
||||||
} else {
|
} else {
|
||||||
@@ -51,6 +51,10 @@ export class FilesState {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (result instanceof ClientDisplayableError) {
|
||||||
|
throw new Error(result.text)
|
||||||
|
}
|
||||||
|
|
||||||
if (isUsingStreamingSaver) {
|
if (isUsingStreamingSaver) {
|
||||||
await saver.finish()
|
await saver.finish()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user