File tree Expand file tree Collapse file tree
packages/ui/src/components/UserProfile Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ export const ConnectedAccountsSection = withCardStateProvider(
6767 ...user . unverifiedExternalAccounts . filter ( a => a . verification ?. error ) ,
6868 ] ;
6969
70+ if ( accounts . length === 0 ) {
71+ return null ;
72+ }
73+
7074 return (
7175 < ProfileSection . Root
7276 title = { localizationKeys ( 'userProfile.start.connectedAccountsSection.title' ) }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import type {
55 EnterpriseAccountConnectionResource ,
66 EnterpriseAccountResource ,
77 OAuthProvider ,
8+ SamlIdpSlug ,
89} from '@clerk/shared/types' ;
910import { Fragment , useState } from 'react' ;
1011
@@ -56,7 +57,10 @@ const EnterpriseConnectMenuButton = (props: { connection: EnterpriseAccountConne
5657 } ) ;
5758 } ;
5859
59- const providerWithoutPrefix = connection ?. name ;
60+ const providerWithoutPrefix = connection . provider . replace ( / ( o a u t h _ | s a m l _ ) / , '' ) . trim ( ) as OAuthProvider ;
61+ const providerIconElementId = ( connection . protocol === 'saml' ? connection . provider : providerWithoutPrefix ) as
62+ | OAuthProvider
63+ | SamlIdpSlug ;
6064
6165 return (
6266 < ProfileSection . ActionMenuItem
@@ -84,7 +88,7 @@ const EnterpriseConnectMenuButton = (props: { connection: EnterpriseAccountConne
8488 isDisabled = { card . isLoading }
8589 alt = { `Connect ${ connection . name } account` }
8690 elementDescriptor = { descriptors . providerIcon }
87- elementId = { descriptors . providerIcon . setId ( providerWithoutPrefix ) }
91+ elementId = { descriptors . providerIcon . setId ( providerIconElementId ) }
8892 />
8993 }
9094 />
You can’t perform that action at this time.
0 commit comments