@@ -74,6 +74,13 @@ function navigateAfterOnboarding(
7474) {
7575 setDisableDismissOnEscape ( false ) ;
7676
77+ // Honor a pending /concierge deep-link intent before any other navigation decision.
78+ // The user explicitly opened /concierge before signing up, so Concierge takes priority.
79+ if ( consumePendingConciergeDeepLink ( ) ) {
80+ Navigation . navigate ( conciergeReportID ? ROUTES . REPORT_WITH_ID . getRoute ( conciergeReportID ) : ( ROUTES . CONCIERGE as Route ) ) ;
81+ return ;
82+ }
83+
7784 // On mobile (small screen), Track workspace admins with the trackExpensesWithConcierge variant
7885 // should navigate directly to the Concierge DM (which contains onboarding tasks).
7986 // This check is outside shouldOpenRHPVariant because that function returns false on native
@@ -100,8 +107,6 @@ function navigateAfterOnboarding(
100107 ) ;
101108 if ( reportID ) {
102109 Navigation . navigate ( ROUTES . REPORT_WITH_ID . getRoute ( reportID ) ) ;
103- } else if ( consumePendingConciergeDeepLink ( ) ) {
104- Navigation . navigate ( conciergeReportID ? ROUTES . REPORT_WITH_ID . getRoute ( conciergeReportID ) : ( ROUTES . CONCIERGE as Route ) ) ;
105110 } else {
106111 // Navigate to home to trigger guard evaluation
107112 Navigation . navigate ( ROUTES . HOME ) ;
@@ -137,10 +142,16 @@ function navigateAfterOnboardingWithMicrotaskQueue(
137142 * After creating or joining a Submit workspace during onboarding,
138143 * navigate to Workspace > Categories with the side panel open so
139144 * the #admins room is visible in Concierge Anywhere.
145+ * If the user arrived via a Concierge deep link, navigate to Concierge instead.
140146 */
141- function navigateToSubmitWorkspaceAfterOnboarding ( policyID ?: string , shouldUseNarrowLayout = false ) {
147+ function navigateToSubmitWorkspaceAfterOnboarding ( policyID ?: string , shouldUseNarrowLayout = false , conciergeReportID ?: string ) {
142148 setDisableDismissOnEscape ( false ) ;
143149
150+ if ( consumePendingConciergeDeepLink ( ) ) {
151+ Navigation . navigate ( conciergeReportID ? ROUTES . REPORT_WITH_ID . getRoute ( conciergeReportID ) : ( ROUTES . CONCIERGE as Route ) ) ;
152+ return ;
153+ }
154+
144155 if ( ! policyID ) {
145156 Navigation . navigate ( ROUTES . HOME ) ;
146157 return ;
@@ -155,10 +166,10 @@ function navigateToSubmitWorkspaceAfterOnboarding(policyID?: string, shouldUseNa
155166 SidePanelActions . openSidePanel ( ! shouldUseNarrowLayout ) ;
156167}
157168
158- function navigateToSubmitWorkspaceAfterOnboardingWithMicrotaskQueue ( policyID ?: string , shouldUseNarrowLayout = false ) {
169+ function navigateToSubmitWorkspaceAfterOnboardingWithMicrotaskQueue ( policyID ?: string , shouldUseNarrowLayout = false , conciergeReportID ?: string ) {
159170 Navigation . dismissModal ( ) ;
160171 Navigation . setNavigationActionToMicrotaskQueue ( ( ) => {
161- navigateToSubmitWorkspaceAfterOnboarding ( policyID , shouldUseNarrowLayout ) ;
172+ navigateToSubmitWorkspaceAfterOnboarding ( policyID , shouldUseNarrowLayout , conciergeReportID ) ;
162173 } ) ;
163174}
164175
0 commit comments