diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index f24a10070cd1..a85e97a4cf05 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -108,9 +108,10 @@ function isExpensifyGuideTeam(email: string): boolean { */ const isPolicyAdmin = (policy: OnyxEntry | EmptyObject): boolean => policy?.role === CONST.POLICY.ROLE.ADMIN; -const isCollectPolicy = (policy: OnyxEntry | EmptyObject): boolean => policy?.type === CONST.POLICY.TYPE.TEAM; - -const isFreePolicy = (policy: OnyxEntry | EmptyObject): boolean => policy?.type === CONST.POLICY.TYPE.FREE; +/** + * Checks if the policy is a free group policy. + */ +const isFreeGroupPolicy = (policy: OnyxEntry | EmptyObject): boolean => policy?.type === CONST.POLICY.TYPE.FREE; const isPolicyMember = (policyID: string, policies: OnyxCollection): boolean => Object.values(policies ?? {}).some((policy) => policy?.id === policyID); @@ -262,8 +263,7 @@ export { isExpensifyTeam, isExpensifyGuideTeam, isInstantSubmitEnabled, - isCollectPolicy, - isFreePolicy, + isFreeGroupPolicy, isPolicyAdmin, isSubmitAndClose, getMemberAccountIDsForWorkspace, diff --git a/src/pages/workspace/WorkspaceInitialPage.tsx b/src/pages/workspace/WorkspaceInitialPage.tsx index 3a75c000b7db..70d871849ee6 100644 --- a/src/pages/workspace/WorkspaceInitialPage.tsx +++ b/src/pages/workspace/WorkspaceInitialPage.tsx @@ -98,8 +98,8 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, policyMembers, r const hasGeneralSettingsError = !isEmptyObject(policy?.errorFields?.generalSettings ?? {}) || !isEmptyObject(policy?.errorFields?.avatar ?? {}); const shouldShowProtectedItems = PolicyUtils.isPolicyAdmin(policy); - const isCollectPolicy = PolicyUtils.isCollectPolicy(policy); - const isFreePolicy = PolicyUtils.isFreePolicy(policy); + const isPaidGroupPolicy = PolicyUtils.isPaidGroupPolicy(policy); + const isFreeGroupPolicy = PolicyUtils.isFreeGroupPolicy(policy); const protectedFreePolicyMenuItems: WorkspaceMenuItem[] = [ { @@ -168,8 +168,8 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, policyMembers, r brickRoadIndicator: hasGeneralSettingsError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, routeName: SCREENS.WORKSPACE.PROFILE, }, - ...(isCollectPolicy && shouldShowProtectedItems ? protectedCollectPolicyMenuItems : []), - ...(isFreePolicy && shouldShowProtectedItems ? protectedFreePolicyMenuItems : []), + ...(isPaidGroupPolicy && shouldShowProtectedItems ? protectedCollectPolicyMenuItems : []), + ...(isFreeGroupPolicy && shouldShowProtectedItems ? protectedFreePolicyMenuItems : []), ]; const prevPolicy = usePrevious(policy);