diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index fbf01c135e098..191afc544a3f9 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -2154,7 +2154,11 @@ function deleteReportComment( // we should navigate to its report in order to not show not found page if (Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(reportID, reportActionID)) && !isDeletedParentAction) { Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(reportID)); - } else if (Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(reportAction.childReportID)) && !isDeletedParentAction) { + } else if ( + (Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(reportAction.childReportID)) || + Navigation.isActiveRoute(ROUTES.SEARCH_REPORT.getRoute({reportID: reportAction.childReportID}))) && + !isDeletedParentAction + ) { Navigation.goBack(undefined); } } diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 99e14c82338a5..8de1657430f66 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -737,6 +737,10 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr // Early return if the report we're passing isn't in a focused state. We only want to navigate to Concierge if the user leaves the room from another device or gets removed from the room while the report is in a focused state. // Prevent auto navigation for report in RHP if ((!isFocused && !isHoldScreenOpenInRHP && !isReportDetailOpenInRHP) || (!isHoldScreenOpenInRHP && isInNarrowPaneModal)) { + if (isInNarrowPaneModal) { + Navigation.goBack(backTo as Route); + return; + } return; } Navigation.dismissModal();