@@ -12,6 +12,7 @@ import useLocalize from '@hooks/useLocalize';
12
12
import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
13
13
import useThemeStyles from '@hooks/useThemeStyles' ;
14
14
import Navigation from '@libs/Navigation/Navigation' ;
15
+ import * as PolicyUtils from '@libs/PolicyUtils' ;
15
16
import * as Policy from '@userActions/Policy/Policy' ;
16
17
import * as Welcome from '@userActions/Welcome' ;
17
18
import CONST from '@src/CONST' ;
@@ -29,6 +30,10 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
29
30
const [ onboardingCompanySize ] = useOnyx ( ONYXKEYS . ONBOARDING_COMPANY_SIZE ) ;
30
31
const [ onboardingPurposeSelected ] = useOnyx ( ONYXKEYS . ONBOARDING_PURPOSE_SELECTED ) ;
31
32
const [ onboardingPolicyID ] = useOnyx ( ONYXKEYS . ONBOARDING_POLICY_ID ) ;
33
+ const [ allPolicies ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY ) ;
34
+
35
+ const paidGroupPolicy = Object . values ( allPolicies ?? { } ) . find ( PolicyUtils . isPaidGroupPolicy ) ;
36
+
32
37
const { onboardingIsMediumOrLargerScreenWidth} = useResponsiveLayout ( ) ;
33
38
const [ selectedCompanySize , setSelectedCompanySize ] = useState < OnboardingCompanySize | null | undefined > ( onboardingCompanySize ) ;
34
39
const [ error , setError ] = useState ( '' ) ;
@@ -63,7 +68,7 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
63
68
}
64
69
Welcome . setOnboardingCompanySize ( selectedCompanySize ) ;
65
70
66
- if ( ! onboardingPolicyID ) {
71
+ if ( ! onboardingPolicyID && ! paidGroupPolicy ) {
67
72
const { adminsChatReportID, policyID} = Policy . createWorkspace ( undefined , true , '' , Policy . generatePolicyID ( ) , CONST . ONBOARDING_CHOICES . MANAGE_TEAM ) ;
68
73
Welcome . setOnboardingAdminsChatReportID ( adminsChatReportID ) ;
69
74
Welcome . setOnboardingPolicyID ( policyID ) ;
0 commit comments