diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 3e83281dc83f..742e5fa296ea 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -2466,12 +2466,13 @@ function navigateToMostRecentReport(currentReport: OnyxEntry) { const lastAccessedReportID = filteredReportsByLastRead.at(-1)?.reportID; const isChatThread = ReportUtils.isChatThread(currentReport); if (lastAccessedReportID) { + const lastAccessedReportRoute = ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID ?? ''); // If it is not a chat thread we should call Navigation.goBack to pop the current route first before navigating to last accessed report. if (!isChatThread) { // Fallback to the lastAccessedReportID route, if this is first route in the navigator - Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID ?? '')); + Navigation.goBack(lastAccessedReportRoute); } - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID ?? ''), CONST.NAVIGATION.TYPE.FORCED_UP); + Navigation.navigate(lastAccessedReportRoute, CONST.NAVIGATION.TYPE.FORCED_UP); } else { const participantAccountIDs = PersonalDetailsUtils.getAccountIDsByLogins([CONST.EMAIL.CONCIERGE]); const chat = ReportUtils.getChatByParticipants(participantAccountIDs);