Skip to content

Commit

Permalink
Merge pull request #28702 from dukenv0307/fix/28087
Browse files Browse the repository at this point in the history
Fix LHN is disappeared when leaving thread
  • Loading branch information
arosiclair authored Oct 5, 2023
2 parents 7baf9c0 + 778ddbd commit 25f7ac1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
9 changes: 0 additions & 9 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1952,15 +1952,6 @@ function leaveRoom(reportID) {
],
},
);
Navigation.dismissModal();
if (Navigation.getTopmostReportId() === reportID) {
Navigation.goBack(ROUTES.HOME);
}
if (report.parentReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.parentReportID), CONST.NAVIGATION.TYPE.FORCED_UP);
return;
}
navigateToConciergeChat();
}

/**
Expand Down
12 changes: 10 additions & 2 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,15 @@ function ReportScreen({
// optimistic case
(prevOnyxReportID && prevOnyxReportID === routeReportID && !onyxReportID && prevReport.statusNum === CONST.REPORT.STATUS.OPEN && report.statusNum === CONST.REPORT.STATUS.CLOSED)
) {
Navigation.goBack();
Navigation.dismissModal();
if (Navigation.getTopmostReportId() === prevOnyxReportID) {
Navigation.setShouldPopAllStateOnUP();
Navigation.goBack(ROUTES.HOME, false, true);
}
if (prevReport.parentReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(prevReport.parentReportID));
return;
}
Report.navigateToConciergeChat();
return;
}
Expand All @@ -329,7 +337,7 @@ function ReportScreen({

fetchReportIfNeeded();
ComposerActions.setShouldShowComposeInput(true);
}, [route, report, errors, fetchReportIfNeeded, prevReport.reportID, prevUserLeavingStatus, userLeavingStatus, prevReport.statusNum]);
}, [route, report, errors, fetchReportIfNeeded, prevReport.reportID, prevUserLeavingStatus, userLeavingStatus, prevReport.statusNum, prevReport.parentReportID]);

useEffect(() => {
// Ensures subscription event succeeds when the report/workspace room is created optimistically.
Expand Down

0 comments on commit 25f7ac1

Please sign in to comment.