From faf8e07ed820c584a8b8b5f6e473e7609b59250e Mon Sep 17 00:00:00 2001 From: renoseHarsh Date: Tue, 20 Aug 2024 18:31:31 +0530 Subject: [PATCH] Applied Required Changes --- src/Components/Common/FilePreviewDialog.tsx | 38 +++++++++------------ 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/src/Components/Common/FilePreviewDialog.tsx b/src/Components/Common/FilePreviewDialog.tsx index 153c68be397..7a8cdb27cfc 100644 --- a/src/Components/Common/FilePreviewDialog.tsx +++ b/src/Components/Common/FilePreviewDialog.tsx @@ -78,7 +78,7 @@ const FilePreviewDialog = (props: FilePreviewProps) => { ); setIndex(index); } - }); + }, [uploadedFiles]); const handleZoomIn = () => { const checkFull = file_state.zoom === zoom_values.length; @@ -158,16 +158,14 @@ const FilePreviewDialog = (props: FilePreviewProps) => {
- handleNext(index - 1)} - > - < - + {uploadedFiles && ( + handleNext(index - 1)} + > + < + + )}
{file_state.isImage ? ( {
)}
- handleNext(index + 1)} - > - > - + {uploadedFiles && ( + handleNext(index + 1)} + > + > + + )}