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

Function onSocialError

packages/shared/src/components/auth/AuthOptionsInner.tsx:191–208  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

189 const [socialError, setSocialError] = useState<string>();
190 const socialProviderRef = useRef<string>();
191 const onSocialError = (message: string) => {
192 if (!isStartups) {
193 displayToast(message);
194 return;
195 }
196
197 if (message !== SOCIAL_AUTH_RETRY_MESSAGE) {
198 setSocialError(message);
199 return;
200 }
201
202 const label = providers.find(
203 ({ value }) => value === socialProviderRef.current,
204 )?.label;
205 setSocialError(
206 `${label ?? 'Your provider'} didn't finish signing you in. Try again, or use another option.`,
207 );
208 };
209 const [activeDisplay, setActiveDisplay] = useState(() =>
210 storage.getItem(SIGNIN_METHOD_KEY) && !forceDefaultDisplay && !isStartups
211 ? AuthDisplay.SignBack

Callers 3

handleLoginMessageFunction · 0.85
onProviderClickFunction · 0.85
handleOneTapCredentialFunction · 0.85

Calls 1

displayToastFunction · 0.85

Tested by

no test coverage detected