Skip to content

Commit

Permalink
Merge pull request #22623 from hoangzinh/df/20885
Browse files Browse the repository at this point in the history
Fix User is not navigated to the concierge chat after login on Web
  • Loading branch information
mountiny authored Jul 17, 2023
2 parents c77d896 + 76d5cf8 commit f4ab245
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,9 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p
* This will find an existing chat, or create a new one if none exists, for the given user or set of users. It will then navigate to this chat.
*
* @param {Array} userLogins list of user logins to start a chat report with.
* @param {Boolean} shouldDismissModal a flag to determine if we should dismiss modal before navigate to report or navigate to report directly.
*/
function navigateToAndOpenReport(userLogins) {
function navigateToAndOpenReport(userLogins, shouldDismissModal = true) {
let newChat = {};
const formattedUserLogins = _.map(userLogins, (login) => OptionsListUtils.addSMSDomainIfPhoneNumber(login).toLowerCase());
const chat = ReportUtils.getChatByParticipantsByLoginList(formattedUserLogins);
Expand All @@ -547,7 +548,11 @@ function navigateToAndOpenReport(userLogins) {

// We want to pass newChat here because if anything is passed in that param (even an existing chat), we will try to create a chat on the server
openReport(reportID, userLogins, newChat);
Navigation.dismissModal(reportID);
if (shouldDismissModal) {
Navigation.dismissModal(reportID);
} else {
Navigation.navigate(ROUTES.getReportRoute(reportID));
}
}

/**
Expand Down Expand Up @@ -1249,7 +1254,7 @@ function navigateToConciergeChat() {
// we need to ensure that the server data has been successfully pulled
Welcome.serverDataIsReadyPromise().then(() => {
// If we don't have a chat with Concierge then create it
navigateToAndOpenReport([CONST.EMAIL.CONCIERGE]);
navigateToAndOpenReport([CONST.EMAIL.CONCIERGE], false);
});
} else {
Navigation.navigate(ROUTES.getReportRoute(conciergeChatReportID));
Expand Down

0 comments on commit f4ab245

Please sign in to comment.