From b9040a9358fbc0bba7d37d5974e6b8593ce9e449 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 23 May 2023 08:47:53 +0500 Subject: [PATCH] mobile: show error on file check failed --- .../mobile/app/components/attachments/actions.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/mobile/app/components/attachments/actions.js b/apps/mobile/app/components/attachments/actions.js index 6d16c9a6e..e6398dda6 100644 --- a/apps/mobile/app/components/attachments/actions.js +++ b/apps/mobile/app/components/attachments/actions.js @@ -102,15 +102,21 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => { if (res.failed) { db.attachments.markAsFailed(attachment.id, res.failed); setFailed(res.failed); + ToastEvent.show({ + heading: "File check failed with error: " + res.failed, + type: "error", + context: "local" + }); } else { setFailed(null); db.attachments.markAsFailed(attachment.id, null); + ToastEvent.show({ + heading: "File check passed", + type: "success", + context: "local" + }); } - ToastEvent.show({ - heading: "File check passed", - type: "success", - context: "local" - }); + setAttachments([...db.attachments.all]); setLoading({ name: null