@@ -29,38 +29,22 @@ Onyx.connectWithoutView({
2929/**
3030 * Determines if the user should be navigated to the RHP variant side panel after onboarding.
3131 * The RHP variant is only shown to micro companies that are part of the RHP experiment.
32- *
33- * Accepts an optional variantOverride to bypass the module-level Onyx variable, avoiding a race
34- * condition where the Onyx callback hasn't fired yet when this is called immediately after the
35- * CompleteGuidedSetup API response.
3632 */
37- const shouldOpenRHPVariant : ShouldOpenRHPVariant = ( variantOverride ) => {
38- const variant = variantOverride ?? onboardingRHPVariant ;
33+ const shouldOpenRHPVariant : ShouldOpenRHPVariant = ( ) => {
3934 const isMicroCompany = onboardingCompanySize === CONST . ONBOARDING_COMPANY_SIZE . MICRO ;
40- const isRHPConciergeDM = variant === CONST . ONBOARDING_RHP_VARIANT . RHP_CONCIERGE_DM ;
41- const isRHPAdminsRoom = variant === CONST . ONBOARDING_RHP_VARIANT . RHP_ADMINS_ROOM ;
42- const isRHPHomePage = variant === CONST . ONBOARDING_RHP_VARIANT . RHP_HOME_PAGE ;
35+ const isRHPConciergeDM = onboardingRHPVariant === CONST . ONBOARDING_RHP_VARIANT . RHP_CONCIERGE_DM ;
36+ const isRHPAdminsRoom = onboardingRHPVariant === CONST . ONBOARDING_RHP_VARIANT . RHP_ADMINS_ROOM ;
4337
44- return isMicroCompany && ( isRHPConciergeDM || isRHPAdminsRoom || isRHPHomePage ) ;
38+ return isMicroCompany && ( isRHPConciergeDM || isRHPAdminsRoom ) ;
4539} ;
4640
4741/**
4842 * Handles navigation for RHP experiment:
4943 * - Control: navigate to the last accessed report on small screens, do not open side panel
5044 * - RHP Concierge DM: navigate to the workspace overview and open the side panel with the Concierge DM
5145 * - RHP Admins Room: navigate to the workspace overview and open the side panel with the Admins Room
52- * - RHP Home Page: navigate to the Home page and open the side panel with the Concierge DM
53- *
54- * Accepts an optional variantOverride for the same race-condition reason as shouldOpenRHPVariant.
5546 */
56- const handleRHPVariantNavigation : HandleRHPVariantNavigation = ( onboardingPolicyID , variantOverride ) => {
57- const variant = variantOverride ?? onboardingRHPVariant ;
58- if ( variant === CONST . ONBOARDING_RHP_VARIANT . RHP_HOME_PAGE ) {
59- Navigation . navigate ( ROUTES . HOME ) ;
60- SidePanelActions . openSidePanel ( true ) ;
61- return ;
62- }
63-
47+ const handleRHPVariantNavigation : HandleRHPVariantNavigation = ( onboardingPolicyID ) => {
6448 Navigation . navigate ( ROUTES . WORKSPACE_OVERVIEW . getRoute ( onboardingPolicyID ) ) ;
6549 SidePanelActions . openSidePanel ( true ) ;
6650} ;
0 commit comments