Skip to content

Commit

Permalink
Merge pull request Expensify#27635 from dukenv0307/fix/27274
Browse files Browse the repository at this point in the history
fix: text disappear before modal closure
  • Loading branch information
johnmlee101 authored Sep 20, 2023
2 parents 45f232a + 170eb33 commit 5723f69
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/libs/actions/Receipt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@ function clearUploadReceiptError() {
});
}

/**
* Close the receipt modal
*/
function closeUploadReceiptModal() {
Onyx.merge(ONYXKEYS.RECEIPT_MODAL, {
isAttachmentInvalid: false,
});
}

export default {
setUploadReceiptError,
clearUploadReceiptError,
closeUploadReceiptModal,
};
5 changes: 3 additions & 2 deletions src/pages/iou/ReceiptSelector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,13 @@ function ReceiptSelector(props) {
/>
<ConfirmModal
title={attachmentInvalidReasonTitle ? translate(attachmentInvalidReasonTitle) : ''}
onConfirm={Receipt.clearUploadReceiptError}
onCancel={Receipt.clearUploadReceiptError}
onConfirm={Receipt.closeUploadReceiptModal}
onCancel={Receipt.closeUploadReceiptModal}
isVisible={isAttachmentInvalid}
prompt={attachmentInvalidReason ? translate(attachmentInvalidReason) : ''}
confirmText={translate('common.close')}
shouldShowCancelButton={false}
onModalHide={Receipt.clearUploadReceiptError}
/>
</View>
);
Expand Down

0 comments on commit 5723f69

Please sign in to comment.