Skip to content

Commit

Permalink
Revert "Merge pull request #40701 from Expensify/monil-fixRouting"
Browse files Browse the repository at this point in the history
This reverts commit a310f77, reversing
changes made to db9be2c.
  • Loading branch information
grgia committed Apr 29, 2024
1 parent c7b6e35 commit ca5ba34
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2462,13 +2462,11 @@ function navigateToMostRecentReport(currentReport: OnyxEntry<Report>) {
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(lastAccessedReportRoute);
Navigation.goBack();
}
Navigation.navigate(lastAccessedReportRoute, CONST.NAVIGATION.TYPE.FORCED_UP);
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID ?? ''), CONST.NAVIGATION.TYPE.FORCED_UP);
} else {
const participantAccountIDs = PersonalDetailsUtils.getAccountIDsByLogins([CONST.EMAIL.CONCIERGE]);
const chat = ReportUtils.getChatByParticipants(participantAccountIDs);
Expand Down

0 comments on commit ca5ba34

Please sign in to comment.