From c3221789e98f441f6bbef567305cf868af44e346 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 6 Oct 2025 21:48:02 +0800 Subject: [PATCH] fix a new report screen is added when pressing new msg badge --- src/pages/home/report/ReportActionsList.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index daca322250e4..16370ea2371c 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -187,6 +187,7 @@ function ReportActionsList({ const [isScrollToBottomEnabled, setIsScrollToBottomEnabled] = useState(false); const [actionIdToHighlight, setActionIdToHighlight] = useState(''); + const backTo = route?.params?.backTo as string; // Display the new message indicator when comment linking and not close to the newest message. const reportActionID = route?.params?.reportActionID; @@ -533,12 +534,12 @@ function ReportActionsList({ if (!hasNewestReportAction) { if (isSearchTopmostFullScreenRoute()) { if (Navigation.getReportRHPActiveRoute()) { - Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: report.reportID})); + Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: report.reportID, backTo})); } else { - Navigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: report.reportID})); + Navigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: report.reportID, backTo})); } } else { - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID)); + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID, undefined, undefined, backTo)); } openReport(report.reportID); reportScrollManager.scrollToBottom(); @@ -547,7 +548,7 @@ function ReportActionsList({ reportScrollManager.scrollToBottom(); readActionSkipped.current = false; readNewestAction(report.reportID); - }, [setIsFloatingMessageCounterVisible, hasNewestReportAction, reportScrollManager, report.reportID]); + }, [setIsFloatingMessageCounterVisible, hasNewestReportAction, reportScrollManager, report.reportID, backTo]); /** * Calculates the ideal number of report actions to render in the first render, based on the screen height and on