Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Jan 31, 2024
1 parent 2c67081 commit 3ea3027
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/AttachmentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function AttachmentModal({
const deleteAndCloseModal = useCallback(() => {
IOU.detachReceipt(transaction?.transactionID);
setIsDeleteReceiptConfirmModalVisible(false);
Navigation.dismissModalWithReportID(report?.reportID ?? '');
Navigation.dismissModalWithReportID(report?.reportID);
}, [transaction, report]);

const isValidFile = useCallback((fileObject: FileObject) => {
Expand Down
6 changes: 5 additions & 1 deletion src/libs/Navigation/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ const dismissModal = (ref = navigationRef) => originalDismissModal(ref);
// Then we can pass the report as a param without getting it from the Onyx.
const dismissModalWithReport = (report: Report | EmptyObject, ref = navigationRef) => originalDismissModalWithReport(report, ref);

const dismissModalWithReportID = (reportID: string, ref = navigationRef) => {
const dismissModalWithReportID = (reportID?: string, ref = navigationRef) => {
if (!reportID) {
dismissModal(ref);
return;
}
const report = getReport(reportID);
originalDismissModalWithReport({reportID, ...report}, ref);
};
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ function navigateToConciergeChat(ignoreConciergeReportID = false, shouldDismissM
navigateToAndOpenReport([CONST.EMAIL.CONCIERGE], shouldDismissModal);
});
} else if (shouldDismissModal) {
Navigation.dismissModal(conciergeChatReportID);
Navigation.dismissModalWithReportID(conciergeChatReportID);
} else {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(conciergeChatReportID));
}
Expand Down

0 comments on commit 3ea3027

Please sign in to comment.