diff --git a/client/src/Login.tsx b/client/src/Login.tsx index 89b0f98..5d15ff1 100644 --- a/client/src/Login.tsx +++ b/client/src/Login.tsx @@ -11,8 +11,8 @@ export default function Login() { const loginRef = useRef(null); const doLogin = useCallback(() => { - // Netuším proč mě TypeScript seřve když se to pokusím zchainovat dohromady - if (loginRef?.current?.value && loginRef?.current?.value.length > 0) { + const length = loginRef?.current?.value && loginRef?.current?.value.length && loginRef.current.value.replace(/\s/g, '').length + if (length) { auth?.setLogin(loginRef.current.value); } }, []);