Skip to content

Commit 97cc956

Browse files
committed
Update condition for thread back navigation
1 parent 6f04ab8 commit 97cc956

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

src/libs/actions/Report.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3495,16 +3495,14 @@ function navigateToMostRecentReport(currentReport: OnyxEntry<Report>) {
34953495

34963496
if (lastAccessedReportID) {
34973497
const lastAccessedReportRoute = ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID);
3498+
const isChatThread = isChatThreadReportUtils(currentReport);
34983499

3499-
if (currentReport?.reportID) {
3500-
const isChatThread = isChatThreadReportUtils(currentReport);
3501-
if (isChatThread) {
3502-
// Using requestAnimationFrame to wait for RHP modal dismissal before navigating, avoiding navigation stack issues on web/desktop.
3503-
requestAnimationFrame(() => {
3504-
Navigation.navigate(lastAccessedReportRoute);
3505-
});
3506-
return;
3507-
}
3500+
if (isChatThread) {
3501+
// Using requestAnimationFrame to wait for RHP modal dismissal before navigating, avoiding navigation stack issues on web/desktop.
3502+
requestAnimationFrame(() => {
3503+
Navigation.navigate(lastAccessedReportRoute);
3504+
});
3505+
return;
35083506
}
35093507

35103508
Navigation.goBack(lastAccessedReportRoute);

0 commit comments

Comments
 (0)