From 9439e70a7bf2dbfe78c3bc666f321927249e9470 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 23 Oct 2023 09:55:34 +0700 Subject: [PATCH 1/3] fix: 30045 --- src/components/AttachmentModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 61b138747950..abede4e5cea1 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -394,7 +394,7 @@ function AttachmentModal(props) { { From 4dcb1ba27be97a60dc5261beeac41d22ff166ea5 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 13 Nov 2023 13:02:00 +0700 Subject: [PATCH 2/3] update condition --- src/components/AttachmentModal.js | 4 +++- src/components/Modal/modalPropTypes.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 8cb09992def6..aa3787f8ab6c 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -127,6 +127,8 @@ function AttachmentModal(props) { const [shouldShowDownloadButton, setShouldShowDownloadButton] = React.useState(true); const {windowWidth} = useWindowDimensions(); + const isOverlayModalVisible = (isAttachmentReceipt && isDeleteReceiptConfirmModalVisible) || (!isAttachmentReceipt && isAttachmentInvalid); + const [file, setFile] = useState( props.originalFileName ? { @@ -398,7 +400,7 @@ function AttachmentModal(props) { { diff --git a/src/components/Modal/modalPropTypes.js b/src/components/Modal/modalPropTypes.js index 84e610b694e4..81cdd41f666a 100644 --- a/src/components/Modal/modalPropTypes.js +++ b/src/components/Modal/modalPropTypes.js @@ -15,7 +15,7 @@ const propTypes = { shouldSetModalVisibility: PropTypes.bool, /** Callback method fired when the user requests to close the modal */ - onClose: PropTypes.func.isRequired, + onClose: PropTypes.func, /** State that determines whether to display the modal or not */ isVisible: PropTypes.bool.isRequired, From c63d3708c8e18626136f461f4ea86a9b4bf7781b Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 22 Nov 2023 18:16:31 +0700 Subject: [PATCH 3/3] update condition for onClose function of the modal --- src/components/AttachmentModal.js | 2 +- src/components/Modal/modalPropTypes.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index a97837b28e4d..d346f271b36d 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -408,7 +408,7 @@ function AttachmentModal(props) { { diff --git a/src/components/Modal/modalPropTypes.js b/src/components/Modal/modalPropTypes.js index 21612a26b9fc..7465e28b28ad 100644 --- a/src/components/Modal/modalPropTypes.js +++ b/src/components/Modal/modalPropTypes.js @@ -15,7 +15,7 @@ const propTypes = { shouldSetModalVisibility: PropTypes.bool, /** Callback method fired when the user requests to close the modal */ - onClose: PropTypes.func, + onClose: PropTypes.func.isRequired, /** State that determines whether to display the modal or not */ isVisible: PropTypes.bool.isRequired,