Skip to content

Commit

Permalink
Use fallback route
Browse files Browse the repository at this point in the history
  • Loading branch information
MonilBhavsar committed Apr 22, 2024
1 parent b1d25e4 commit 636f825
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,8 @@ function navigateToMostRecentReport(currentReport: OnyxEntry<Report>) {
if (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) {
Navigation.goBack();
// Fallback to the lastAccessedReportID route, if this is first route in the navigator
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID ?? ''));
}
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID ?? ''), CONST.NAVIGATION.TYPE.FORCED_UP);
} else {
Expand Down

0 comments on commit 636f825

Please sign in to comment.