@@ -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 ,
@@ -175,7 +175,6 @@ declare global {
175175
176176const CANNOT_RENDER_BILLING_DISABLED_ERROR_CODE = 'cannot_render_billing_disabled' ;
177177const CANNOT_RENDER_USER_MISSING_ERROR_CODE = 'cannot_render_user_missing' ;
178- const CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE = 'cannot_render_organizations_disabled' ;
179178const CANNOT_RENDER_ORGANIZATION_MISSING_ERROR_CODE = 'cannot_render_organization_missing' ;
180179const CANNOT_RENDER_SINGLE_SESSION_ENABLED_ERROR_CODE = 'cannot_render_single_session_enabled' ;
181180const CANNOT_RENDER_API_KEYS_DISABLED_ERROR_CODE = 'cannot_render_api_keys_disabled' ;
@@ -716,16 +715,16 @@ export class Clerk implements ClerkInterface {
716715 void this . #componentControls. ensureMounted ( ) . then ( controls => controls . closeModal ( 'userVerification' ) ) ;
717716 } ;
718717
719- public __internal_openEnableOrganizations = ( props ?: __internal_EnableOrganizationsModalProps ) : void => {
718+ public __internal_openEnableOrganizationsPrompt = ( props ?: __internal_EnableOrganizationsPromptProps ) : void => {
720719 this . assertComponentsReady ( this . #componentControls) ;
721720 void this . #componentControls
722- . ensureMounted ( { preloadHint : 'EnableOrganizations ' } )
723- . then ( controls => controls . openModal ( 'enableOrganizations ' , props || { } ) ) ;
721+ . ensureMounted ( { preloadHint : 'EnableOrganizationsPrompt ' } )
722+ . then ( controls => controls . openModal ( 'enableOrganizationsPrompt ' , props || { } ) ) ;
724723 } ;
725724
726725 public __internal_closeEnableOrganizations = ( ) : void => {
727726 this . assertComponentsReady ( this . #componentControls) ;
728- void this . #componentControls. ensureMounted ( ) . then ( controls => controls . closeModal ( 'enableOrganizations ' ) ) ;
727+ void this . #componentControls. ensureMounted ( ) . then ( controls => controls . closeModal ( 'enableOrganizationsPrompt ' ) ) ;
729728 } ;
730729
731730 public __internal_openBlankCaptchaModal = ( ) : Promise < unknown > => {
@@ -801,8 +800,8 @@ export class Clerk implements ClerkInterface {
801800 this . assertComponentsReady ( this . #componentControls) ;
802801 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
803802 if ( this . #instanceType === 'development' ) {
804- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'OrganizationProfile' ) , {
805- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
803+ this . __internal_openEnableOrganizationsPrompt ( {
804+ callerName : 'OrganizationSwitcher' ,
806805 } ) ;
807806 }
808807 return ;
@@ -831,8 +830,8 @@ export class Clerk implements ClerkInterface {
831830 this . assertComponentsReady ( this . #componentControls) ;
832831 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
833832 if ( this . #instanceType === 'development' ) {
834- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'CreateOrganization' ) , {
835- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
833+ this . __internal_openEnableOrganizationsPrompt ( {
834+ callerName : 'OrganizationSwitcher' ,
836835 } ) ;
837836 }
838837 return ;
@@ -973,8 +972,8 @@ export class Clerk implements ClerkInterface {
973972 this . assertComponentsReady ( this . #componentControls) ;
974973 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
975974 if ( this . #instanceType === 'development' ) {
976- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'OrganizationProfile' ) , {
977- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
975+ this . __internal_openEnableOrganizationsPrompt ( {
976+ callerName : 'OrganizationProfile' ,
978977 } ) ;
979978 }
980979 return ;
@@ -1013,8 +1012,8 @@ export class Clerk implements ClerkInterface {
10131012 this . assertComponentsReady ( this . #componentControls) ;
10141013 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
10151014 if ( this . #instanceType === 'development' ) {
1016- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'CreateOrganization' ) , {
1017- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
1015+ this . __internal_openEnableOrganizationsPrompt ( {
1016+ callerName : 'OrganizationSwitcher' ,
10181017 } ) ;
10191018 }
10201019 return ;
@@ -1044,8 +1043,8 @@ export class Clerk implements ClerkInterface {
10441043 this . assertComponentsReady ( this . #componentControls) ;
10451044 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
10461045 if ( this . #instanceType === 'development' ) {
1047- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'OrganizationSwitcher' ) , {
1048- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
1046+ this . __internal_openEnableOrganizationsPrompt ( {
1047+ callerName : 'OrganizationSwitcher' ,
10491048 } ) ;
10501049 }
10511050 return ;
@@ -1083,8 +1082,8 @@ export class Clerk implements ClerkInterface {
10831082 this . assertComponentsReady ( this . #componentControls) ;
10841083 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
10851084 if ( this . #instanceType === 'development' ) {
1086- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'OrganizationList' ) , {
1087- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
1085+ this . __internal_openEnableOrganizationsPrompt ( {
1086+ callerName : 'OrganizationList' ,
10881087 } ) ;
10891088 }
10901089 return ;
@@ -1270,8 +1269,8 @@ export class Clerk implements ClerkInterface {
12701269
12711270 if ( disabledOrganizationsFeature ( this , this . environment ) ) {
12721271 if ( this . #instanceType === 'development' ) {
1273- throw new ClerkRuntimeError ( warnings . cannotRenderAnyOrganizationComponent ( 'TaskChooseOrganization' ) , {
1274- code : CANNOT_RENDER_ORGANIZATIONS_DISABLED_ERROR_CODE ,
1272+ this . __internal_openEnableOrganizationsPrompt ( {
1273+ callerName : 'OrganizationSwitcher' ,
12751274 } ) ;
12761275 }
12771276 return ;
0 commit comments