From 5bcba77195e2dda5ff0ad6209daeed71368f89af Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 21 Feb 2024 15:51:17 +0800 Subject: [PATCH 1/3] add concierge page to dismiss modal case --- src/libs/Navigation/dismissModal.ts | 1 + src/libs/Navigation/dismissModalWithReport.ts | 1 + src/pages/ConciergePage.tsx | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/Navigation/dismissModal.ts b/src/libs/Navigation/dismissModal.ts index 484008d2e070..1f46f5c37193 100644 --- a/src/libs/Navigation/dismissModal.ts +++ b/src/libs/Navigation/dismissModal.ts @@ -25,6 +25,7 @@ function dismissModal(navigationRef: NavigationContainerRef) case NAVIGATORS.RIGHT_MODAL_NAVIGATOR: case SCREENS.NOT_FOUND: case SCREENS.REPORT_ATTACHMENTS: + case SCREENS.CONCIERGE: navigationRef.dispatch({...StackActions.pop(), target: state.key}); break; default: { diff --git a/src/libs/Navigation/dismissModalWithReport.ts b/src/libs/Navigation/dismissModalWithReport.ts index b708819cdf9c..4fc82f76df86 100644 --- a/src/libs/Navigation/dismissModalWithReport.ts +++ b/src/libs/Navigation/dismissModalWithReport.ts @@ -38,6 +38,7 @@ function dismissModalWithReport(targetReport: Report | EmptyObject, navigationRe case NAVIGATORS.RIGHT_MODAL_NAVIGATOR: case SCREENS.NOT_FOUND: case SCREENS.REPORT_ATTACHMENTS: + case SCREENS.CONCIERGE: // If we are not in the target report, we need to navigate to it after dismissing the modal if (targetReport.reportID !== getTopmostReportId(state)) { const reportState = getStateFromPath(ROUTES.REPORT_WITH_ID.getRoute(targetReport.reportID)); diff --git a/src/pages/ConciergePage.tsx b/src/pages/ConciergePage.tsx index 251728866a54..feb1b9c54f50 100644 --- a/src/pages/ConciergePage.tsx +++ b/src/pages/ConciergePage.tsx @@ -28,8 +28,7 @@ function ConciergePage({session}: ConciergePageProps) { if (session && 'authToken' in session) { // Pop the concierge loading page before opening the concierge report. Navigation.isNavigationReady().then(() => { - Navigation.goBack(); - Report.navigateToConciergeChat(); + Report.navigateToConciergeChat(undefined, true); }); } else { Navigation.navigate(); From 637af8a0521244a4bc5e94818701ed05677c923a Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 26 Feb 2024 13:56:16 +0800 Subject: [PATCH 2/3] remove unused param --- src/libs/actions/Report.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index f29f8a4fbaab..b1405acad98e 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1719,7 +1719,7 @@ function updateWriteCapabilityAndNavigate(report: Report, newValue: WriteCapabil /** * Navigates to the 1:1 report with Concierge */ -function navigateToConciergeChat(shouldDismissModal = false, shouldPopCurrentScreen = false, checkIfCurrentPageActive = () => true) { +function navigateToConciergeChat(shouldDismissModal = false, checkIfCurrentPageActive = () => true) { // If conciergeChatReportID contains a concierge report ID, we navigate to the concierge chat using the stored report ID. // Otherwise, we would find the concierge chat and navigate to it. if (!conciergeChatReportID) { @@ -1730,17 +1730,11 @@ function navigateToConciergeChat(shouldDismissModal = false, shouldPopCurrentScr if (!checkIfCurrentPageActive()) { return; } - if (shouldPopCurrentScreen && !shouldDismissModal) { - Navigation.goBack(); - } navigateToAndOpenReport([CONST.EMAIL.CONCIERGE], shouldDismissModal); }); } else if (shouldDismissModal) { Navigation.dismissModal(conciergeChatReportID); } else { - if (shouldPopCurrentScreen) { - Navigation.goBack(); - } Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(conciergeChatReportID)); } } From f5a0bd4d4a892a80e7150150f790811e06ea8460 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 26 Feb 2024 13:56:21 +0800 Subject: [PATCH 3/3] fix param --- src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx | 2 +- .../ConnectBankAccount/ConnectBankAccount.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx b/src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx index 025dcafd9740..9ad19482a4a7 100644 --- a/src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx +++ b/src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx @@ -90,7 +90,7 @@ function PurposeForUsingExpensifyModal() { } Report.completeEngagementModal(message, choice); - Report.navigateToConciergeChat(false, true); + Report.navigateToConciergeChat(true); }, []); const menuItems: MenuItemProps[] = useMemo( diff --git a/src/pages/ReimbursementAccount/ConnectBankAccount/ConnectBankAccount.tsx b/src/pages/ReimbursementAccount/ConnectBankAccount/ConnectBankAccount.tsx index 1682cb66f7c8..078c216d836c 100644 --- a/src/pages/ReimbursementAccount/ConnectBankAccount/ConnectBankAccount.tsx +++ b/src/pages/ReimbursementAccount/ConnectBankAccount/ConnectBankAccount.tsx @@ -39,7 +39,7 @@ function ConnectBankAccount({reimbursementAccount, onBackButtonPress, account, p const styles = useThemeStyles(); const {translate} = useLocalize(); - const handleNavigateToConciergeChat = () => Report.navigateToConciergeChat(false, true); + const handleNavigateToConciergeChat = () => Report.navigateToConciergeChat(true); const bankAccountState = reimbursementAccount.achData?.state ?? ''; // If a user tries to navigate directly to the validate page we'll show them the EnableStep