From c0106ab55abf14c319a00008b3735355b4c34661 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 28 May 2024 14:02:30 +0800 Subject: [PATCH 1/2] show not found view when the attachment is invalid --- src/components/Attachments/AttachmentCarousel/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Attachments/AttachmentCarousel/index.tsx b/src/components/Attachments/AttachmentCarousel/index.tsx index 42536ae208ae..c525c5a8e11c 100644 --- a/src/components/Attachments/AttachmentCarousel/index.tsx +++ b/src/components/Attachments/AttachmentCarousel/index.tsx @@ -51,6 +51,9 @@ function AttachmentCarousel({report, reportActions, parentReportActions, source, const attachmentsFromReport = extractAttachmentsFromReport(parentReportAction, reportActions ?? undefined); if (isEqual(attachments, attachmentsFromReport)) { + if (attachments.length === 0) { + setPage(-1); + } return; } From 5e677ee41e13fd242c2327dae20065321bae020f Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 28 May 2024 15:23:37 +0800 Subject: [PATCH 2/2] hide download button when not found --- src/components/Attachments/AttachmentCarousel/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Attachments/AttachmentCarousel/index.tsx b/src/components/Attachments/AttachmentCarousel/index.tsx index c525c5a8e11c..e437498d5947 100644 --- a/src/components/Attachments/AttachmentCarousel/index.tsx +++ b/src/components/Attachments/AttachmentCarousel/index.tsx @@ -53,6 +53,7 @@ function AttachmentCarousel({report, reportActions, parentReportActions, source, if (isEqual(attachments, attachmentsFromReport)) { if (attachments.length === 0) { setPage(-1); + setDownloadButtonVisibility?.(false); } return; }