Skip to content

Commit 6d302cb

Browse files
committed
return the count
1 parent a4ee67b commit 6d302cb

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function SignInStartInternal(): JSX.Element {
8888
const ctx = useSignInContext();
8989
const { afterSignInUrl, signUpUrl, waitlistUrl, isCombinedFlow, navigateOnSetActive } = ctx;
9090
const supportEmail = useSupportEmail();
91-
const { totalCount: totalEnabledAuthMethods } = useTotalEnabledAuthMethods();
91+
const totalEnabledAuthMethods = useTotalEnabledAuthMethods();
9292
const identifierAttributes = useMemo<SignInStartIdentifier[]>(
9393
() => groupIdentifiers(userSettings.enabledFirstFactorIdentifiers),
9494
[userSettings.enabledFirstFactorIdentifiers],

packages/clerk-js/src/ui/elements/SocialButtons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const SocialButtons = React.memo((props: SocialButtonsRootProps) => {
6666
} = props;
6767
const { web3Strategies, authenticatableOauthStrategies, strategyToDisplayData, alternativePhoneCodeChannels } =
6868
useEnabledThirdPartyProviders();
69-
const { totalCount: totalEnabledAuthMethods } = useTotalEnabledAuthMethods();
69+
const totalEnabledAuthMethods = useTotalEnabledAuthMethods();
7070
const card = useCardState();
7171
const clerk = useClerk();
7272
const { socialButtonsVariant } = useAppearance().parsedLayout;

packages/clerk-js/src/ui/elements/__tests__/SocialButtons.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ describe('SocialButtons', () => {
136136

137137
// Verify the total count is actually 1 using the hook
138138
const { result } = renderHook(() => useTotalEnabledAuthMethods(), { wrapper });
139-
expect(result.current.totalCount).toBe(1);
139+
expect(result.current).toBe(1);
140140

141141
fixtures.clerk.client.lastAuthenticationStrategy = 'oauth_google';
142142

@@ -165,7 +165,7 @@ describe('SocialButtons', () => {
165165

166166
// Verify the total count is 2 (email + google)
167167
const { result } = renderHook(() => useTotalEnabledAuthMethods(), { wrapper });
168-
expect(result.current.totalCount).toBe(2);
168+
expect(result.current).toBe(2);
169169

170170
fixtures.clerk.client.lastAuthenticationStrategy = 'oauth_google';
171171

packages/clerk-js/src/ui/hooks/useTotalEnabledAuthMethods.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Attribute } from '@clerk/shared/types';
33
import { useEnvironment } from '../contexts/EnvironmentContext';
44
import { useEnabledThirdPartyProviders } from './useEnabledThirdPartyProviders';
55

6-
export const useTotalEnabledAuthMethods = (): { totalCount: number } => {
6+
export const useTotalEnabledAuthMethods = (): number => {
77
const { userSettings } = useEnvironment();
88
const { authenticatableOauthStrategies, web3Strategies, alternativePhoneCodeChannels } =
99
useEnabledThirdPartyProviders();
@@ -18,5 +18,5 @@ export const useTotalEnabledAuthMethods = (): { totalCount: number } => {
1818

1919
const totalCount = firstFactorCount + oauthCount + web3Count + alternativePhoneCodeCount;
2020

21-
return { totalCount };
21+
return totalCount;
2222
};

0 commit comments

Comments
 (0)