diff --git a/apps/mobile/app/common/filesystem/download-attachment.js b/apps/mobile/app/common/filesystem/download-attachment.js index 34ca2c5a4..c0ca928b8 100644 --- a/apps/mobile/app/common/filesystem/download-attachment.js +++ b/apps/mobile/app/common/filesystem/download-attachment.js @@ -130,7 +130,7 @@ export async function downloadAttachments( RNFetchBlob.fs.unlink(zipSourceFolder).catch(console.log); return; } - if (result.size) { + if (result?.size) { let sub; try { onProgress?.(0, `Zipping... Please wait`); diff --git a/apps/mobile/app/components/attachments/download-attachments.js b/apps/mobile/app/components/attachments/download-attachments.js index 6514a4e7f..71b9deb8e 100644 --- a/apps/mobile/app/components/attachments/download-attachments.js +++ b/apps/mobile/app/components/attachments/download-attachments.js @@ -55,7 +55,7 @@ const DownloadAttachments = ({ close, attachments, isNote, update }) => { groupId.current ); if (canceled.current) return; - setResult(result); + setResult(result || new Map()); setDownloading(false); update({ disableClosing: false @@ -113,7 +113,7 @@ const DownloadAttachments = ({ close, attachments, isNote, update }) => { {downloading ? "Downloading attachments" - : result.size + : result?.size ? "Downloaded attachments" : "Download attachments"} @@ -126,7 +126,7 @@ const DownloadAttachments = ({ close, attachments, isNote, update }) => { > {progress.statusText} - ) : result.size ? ( + ) : result?.size ? ( { }} /> - {result.size ? ( + {result?.size ? (