mobile: fix crash on download all attachement

This commit is contained in:
ammarahm-ed
2023-05-31 11:31:13 +05:00
parent abc14d2d1f
commit 70bb789b82
2 changed files with 5 additions and 5 deletions

View File

@@ -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`);

View File

@@ -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 }) => {
<Heading>
{downloading
? "Downloading attachments"
: result.size
: result?.size
? "Downloaded attachments"
: "Download attachments"}
</Heading>
@@ -126,7 +126,7 @@ const DownloadAttachments = ({ close, attachments, isNote, update }) => {
>
{progress.statusText}
</Paragraph>
) : result.size ? (
) : result?.size ? (
<Paragraph
style={{
textAlign: "center"
@@ -200,7 +200,7 @@ const DownloadAttachments = ({ close, attachments, isNote, update }) => {
}}
/>
{result.size ? (
{result?.size ? (
<Button
style={{
width: 250,