@@ -23,7 +23,7 @@ import type {
2323 __experimental_CheckoutInstance ,
2424 __experimental_CheckoutOptions ,
2525 __internal_CheckoutProps ,
26- __internal_EnableOrganizationsModalProps ,
26+ __internal_EnableOrganizationsPromptProps ,
2727 __internal_OAuthConsentProps ,
2828 __internal_PlanDetailsProps ,
2929 __internal_SubscriptionDetailsProps ,
@@ -176,7 +176,6 @@ declare global {
176176
177177const CANNOT_RENDER_BILLING_DISABLED_ERROR_CODE = 'cannot_render_billing_disabled' ;
178178const CANNOT_RENDER_USER_MISSING_ERROR_CODE = 'cannot_render_user_missing' ;
179- const CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE = 'cannot_render_organizations_disabled' ;
180179const CANNOT_RENDER_ORGANIZATION_MISSING_ERROR_CODE = 'cannot_render_organization_missing' ;
181180const CANNOT_RENDER_SINGLE_SESSION_ENABLED_ERROR_CODE = 'cannot_render_single_session_enabled' ;
182181const CANNOT_RENDER_API_KEYS_DISABLED_ERROR_CODE = 'cannot_render_api_keys_disabled' ;
@@ -740,16 +739,16 @@ export class Clerk implements ClerkInterface {
740739 void this . #componentControls. ensureMounted ( ) . then ( controls => controls . closeModal ( 'userVerification' ) ) ;
741740 } ;
742741
743- public __internal_openEnableOrganizations = ( props ?: __internal_EnableOrganizationsModalProps ) : void => {
742+ public __internal_openEnableOrganizationsPrompt = ( props ?: __internal_EnableOrganizationsPromptProps ) : void => {
744743 this . assertComponentsReady ( this . #componentControls) ;
745744 void this . #componentControls
746- . ensureMounted ( { preloadHint : 'EnableOrganizations ' } )
747- . then ( controls => controls . openModal ( 'enableOrganizations ' , props || { } ) ) ;
745+ . ensureMounted ( { preloadHint : 'EnableOrganizationsPrompt ' } )
746+ . then ( controls => controls . openModal ( 'enableOrganizationsPrompt ' , props || { } ) ) ;
748747 } ;
749748
750749 public __internal_closeEnableOrganizations = ( ) : void => {
751750 this . assertComponentsReady ( this . #componentControls) ;
752- void this . #componentControls. ensureMounted ( ) . then ( controls => controls . closeModal ( 'enableOrganizations ' ) ) ;
751+ void this . #componentControls. ensureMounted ( ) . then ( controls => controls . closeModal ( 'enableOrganizationsPrompt ' ) ) ;
753752 } ;
754753
755754 public __internal_openBlankCaptchaModal = ( ) : Promise < unknown > => {
@@ -825,8 +824,8 @@ export class Clerk implements ClerkInterface {
825824 this . assertComponentsReady ( this . #componentControls) ;
826825 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
827826 if ( this . #instanceType === 'development' ) {
828- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'OrganizationProfile' ) , {
829- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
827+ this . __internal_openEnableOrganizationsPrompt ( {
828+ callerName : 'OrganizationSwitcher' ,
830829 } ) ;
831830 }
832831 return ;
@@ -855,8 +854,8 @@ export class Clerk implements ClerkInterface {
855854 this . assertComponentsReady ( this . #componentControls) ;
856855 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
857856 if ( this . #instanceType === 'development' ) {
858- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'CreateOrganization' ) , {
859- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
857+ this . __internal_openEnableOrganizationsPrompt ( {
858+ callerName : 'OrganizationSwitcher' ,
860859 } ) ;
861860 }
862861 return ;
@@ -997,8 +996,8 @@ export class Clerk implements ClerkInterface {
997996 this . assertComponentsReady ( this . #componentControls) ;
998997 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
999998 if ( this . #instanceType === 'development' ) {
1000- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'OrganizationProfile' ) , {
1001- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
999+ this . __internal_openEnableOrganizationsPrompt ( {
1000+ callerName : 'OrganizationProfile' ,
10021001 } ) ;
10031002 }
10041003 return ;
@@ -1037,8 +1036,8 @@ export class Clerk implements ClerkInterface {
10371036 this . assertComponentsReady ( this . #componentControls) ;
10381037 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
10391038 if ( this . #instanceType === 'development' ) {
1040- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'CreateOrganization' ) , {
1041- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
1039+ this . __internal_openEnableOrganizationsPrompt ( {
1040+ callerName : 'OrganizationSwitcher' ,
10421041 } ) ;
10431042 }
10441043 return ;
@@ -1068,8 +1067,8 @@ export class Clerk implements ClerkInterface {
10681067 this . assertComponentsReady ( this . #componentControls) ;
10691068 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
10701069 if ( this . #instanceType === 'development' ) {
1071- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'OrganizationSwitcher' ) , {
1072- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
1070+ this . __internal_openEnableOrganizationsPrompt ( {
1071+ callerName : 'OrganizationSwitcher' ,
10731072 } ) ;
10741073 }
10751074 return ;
@@ -1107,8 +1106,8 @@ export class Clerk implements ClerkInterface {
11071106 this . assertComponentsReady ( this . #componentControls) ;
11081107 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
11091108 if ( this . #instanceType === 'development' ) {
1110- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'OrganizationList' ) , {
1111- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
1109+ this . __internal_openEnableOrganizationsPrompt ( {
1110+ callerName : 'OrganizationList' ,
11121111 } ) ;
11131112 }
11141113 return ;
@@ -1294,8 +1293,8 @@ export class Clerk implements ClerkInterface {
12941293
12951294 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
12961295 if ( this . #instanceType === 'development' ) {
1297- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'TaskChooseOrganization' ) , {
1298- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
1296+ this . __internal_openEnableOrganizationsPrompt ( {
1297+ callerName : 'OrganizationSwitcher' ,
12991298 } ) ;
13001299 }
13011300 return ;
0 commit comments