mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
mobile: fix crash on download all attachement
This commit is contained in:
@@ -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`);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user