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

Function onSocialError

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

Source from the content-addressed store, hash-verified

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

Callers 3

handleLoginMessageFunction · 0.85
onProviderClickFunction · 0.85
handleOneTapCredentialFunction · 0.85

Calls 1

displayToastFunction · 0.85

Tested by

no test coverage detected