Skip to content

Commit

Permalink
Merge pull request #29122 from rojiphil/27042-deeplink-open-concierge
Browse files Browse the repository at this point in the history
ignore concierge report id during deep link launch
  • Loading branch information
pecanoro authored Oct 12, 2023
2 parents 6f533d6 + 8e6c289 commit 6c7ee53
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1401,9 +1401,15 @@ function updateWriteCapabilityAndNavigate(report, newValue) {

/**
* Navigates to the 1:1 report with Concierge
*
* @param {Boolean} ignoreConciergeReportID - Flag to ignore conciergeChatReportID during navigation. The default behavior is to not ignore.
*/
function navigateToConciergeChat() {
if (!conciergeChatReportID) {
function navigateToConciergeChat(ignoreConciergeReportID = false) {
// If conciergeChatReportID contains a concierge report ID, we navigate to the concierge chat using the stored report ID.
// Otherwise, we would find the concierge chat and navigate to it.
// Now, when user performs sign-out and a sign-in again, conciergeChatReportID may contain a stale value.
// In order to prevent navigation to a stale value, we use ignoreConciergeReportID to forcefully find and navigate to concierge chat.
if (!conciergeChatReportID || ignoreConciergeReportID) {
// In order to avoid creating concierge repeatedly,
// we need to ensure that the server data has been successfully pulled
Welcome.serverDataIsReadyPromise().then(() => {
Expand Down Expand Up @@ -1897,7 +1903,7 @@ function openReportFromDeepLink(url, isAuthenticated) {
InteractionManager.runAfterInteractions(() => {
Session.waitForUserSignIn().then(() => {
if (route === ROUTES.CONCIERGE) {
navigateToConciergeChat();
navigateToConciergeChat(true);
return;
}
Navigation.navigate(route, CONST.NAVIGATION.TYPE.PUSH);
Expand Down

0 comments on commit 6c7ee53

Please sign in to comment.