MCPcopy Create free account
hub / github.com/dailydotdev/apps / initializeOnce

Function initializeOnce

packages/shared/src/hooks/auth/useGoogleOneTap.ts:94–113  ·  view source on GitHub ↗
(googleId: GoogleId, clientId: string)

Source from the content-addressed store, hash-verified

92let activeCredentialHandler: ((credential: string) => void) | null = null;
93
94const initializeOnce = (googleId: GoogleId, clientId: string): void => {
95 if (initializedClients.get(googleId) === clientId) {
96 return;
97 }
98
99 initializedClients.set(googleId, clientId);
100 googleId.initialize({
101 client_id: clientId,
102 context: 'signin',
103 auto_select: false,
104 cancel_on_tap_outside: false,
105 ux_mode: 'popup',
106 itp_support: true,
107 callback: ({ credential }) => {
108 if (credential) {
109 activeCredentialHandler?.(credential);
110 }
111 },
112 });
113};
114
115type UseGoogleOneTapProps = {
116 enabled: boolean;

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected