diff --git a/src/Components/Patient/FileUpload.tsx b/src/Components/Patient/FileUpload.tsx index 3fb0fde6229..fe0881e6994 100644 --- a/src/Components/Patient/FileUpload.tsx +++ b/src/Components/Patient/FileUpload.tsx @@ -481,15 +481,20 @@ export const FileUpload = (props: FileUploadProps) => { }; const responseData = await dispatch(retrieveUpload(data, id)); const file_extension = getExtension(responseData.data.read_signed_url); - setFileState({ - ...file_state, - open: true, - name: responseData.data.name, - extension: file_extension, - isImage: ExtImage.includes(file_extension), - }); - downloadFileUrl(responseData.data.read_signed_url); - setFileUrl(responseData.data.read_signed_url); + if (file_extension === "pdf") { + window.open(responseData.data.read_signed_url, "_blank"); + setFileState({ ...file_state, open: false }); + } else { + setFileState({ + ...file_state, + open: true, + name: responseData.data.name, + extension: file_extension, + isImage: ExtImage.includes(file_extension), + }); + downloadFileUrl(responseData.data.read_signed_url); + setFileUrl(responseData.data.read_signed_url); + } }; const validateEditFileName = (name: any) => { @@ -1457,7 +1462,7 @@ export const FileUpload = (props: FileUploadProps) => { )} -
+