diff --git a/app/assets/javascripts/components/AccountMenu/SignIn.tsx b/app/assets/javascripts/components/AccountMenu/SignIn.tsx index 9c187890c53..f4bb3cf1426 100644 --- a/app/assets/javascripts/components/AccountMenu/SignIn.tsx +++ b/app/assets/javascripts/components/AccountMenu/SignIn.tsx @@ -34,7 +34,7 @@ export const SignInPane: FunctionComponent = observer( useEffect(() => { if (emailInputRef?.current) { - emailInputRef.current!.focus(); + emailInputRef.current?.focus(); } }, []); @@ -73,8 +73,8 @@ export const SignInPane: FunctionComponent = observer( const signIn = () => { setIsSigningIn(true); - emailInputRef?.current!.blur(); - passwordInputRef?.current!.blur(); + emailInputRef?.current?.blur(); + passwordInputRef?.current?.blur(); application .signIn(email, password, isStrictSignin, isEphemeral, shouldMergeLocal) @@ -92,7 +92,7 @@ export const SignInPane: FunctionComponent = observer( application.alertService.alert(err); } setPassword(''); - passwordInputRef?.current!.blur(); + passwordInputRef?.current?.blur(); }) .finally(() => { setIsSigningIn(false); @@ -109,12 +109,12 @@ export const SignInPane: FunctionComponent = observer( e.preventDefault(); if (!email || email.length === 0) { - emailInputRef?.current!.focus(); + emailInputRef?.current?.focus(); return; } if (!password || password.length === 0) { - passwordInputRef?.current!.focus(); + passwordInputRef?.current?.focus(); return; } @@ -134,69 +134,67 @@ export const SignInPane: FunctionComponent = observer( />
Sign in
-
-
- - - {isInvalid ? ( -
- Invalid email or password. -
- ) : null} -
-
+ ) : null} +