Skip to content

Commit bf2e82d

Browse files
committed
refactor(ui): resolve composed runtime via helper in OrganizationProfileProvider
Switch OrganizationProfileProvider to resolveComposedClerkRuntime, matching UserProfileProvider and dropping the inline `as any` environment read.
1 parent ee74371 commit bf2e82d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

packages/ui/src/composed/OrganizationProfile/OrganizationProfileProvider.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
'use client';
22

33
import { useClerk, useOrganization, useUser } from '@clerk/shared/react';
4-
import type { EnvironmentResource, OrganizationProfileProps } from '@clerk/shared/types';
4+
import type { OrganizationProfileProps } from '@clerk/shared/types';
55
import type { PropsWithChildren, ReactNode } from 'react';
66

77
import type { Appearance } from '@/ui/internal/appearance';
88

99
import { OrganizationProfileContext } from '../../contexts/components/OrganizationProfile';
1010
import { SubscriberTypeContext } from '../../contexts/components/SubscriberType';
11-
import { fallbackModuleManager, ProfileProviderShell } from '../ProfileProviderShell';
11+
import { ProfileProviderShell, resolveComposedClerkRuntime } from '../ProfileProviderShell';
1212

1313
type OrganizationProfileProviderProps = PropsWithChildren<{
1414
appearance?: Appearance;
@@ -22,8 +22,7 @@ export const OrganizationProfileProvider = (props: OrganizationProfileProviderPr
2222
const { isLoaded, user } = useUser();
2323
const { organization } = useOrganization();
2424

25-
const environment = (clerk as any).__internal_environment as EnvironmentResource | null | undefined;
26-
const moduleManager = clerk.__internal_moduleManager ?? fallbackModuleManager;
25+
const { environment, moduleManager } = resolveComposedClerkRuntime(clerk, isLoaded);
2726

2827
if (!isLoaded || !user || !organization || !environment) {
2928
return null;

0 commit comments

Comments
 (0)