From 9cd9e0fbbe8ffac2c2d8bcb5c91cfe801e744d09 Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Sat, 25 Oct 2025 11:20:57 +0530 Subject: [PATCH] added document files properly handling inside --- src/components/collections/ViewCollection.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/collections/ViewCollection.jsx b/src/components/collections/ViewCollection.jsx index 799033e5..77bc78fe 100644 --- a/src/components/collections/ViewCollection.jsx +++ b/src/components/collections/ViewCollection.jsx @@ -172,15 +172,15 @@ const ViewCollection = ({ onClose }) => {
{data?.attachments?.map((doc) => { - const isImage = doc.contentType?.includes("image"); + const isImage = doc.contentType?.startsWith("image"); return (
{ if (isImage) { @@ -188,6 +188,8 @@ const ViewCollection = ({ onClose }) => { IsOpen: true, Image: doc.preSignedUrl, }); + } else { + window.open(doc.preSignedUrl, "_blank"); } }} >