Neumožnění použití pouze bílých znaků ve jménu

This commit is contained in:
Martin Berka 2023-06-02 20:37:17 +02:00
parent 0771286ba1
commit 3df3bb9541

View File

@ -11,8 +11,8 @@ export default function Login() {
const loginRef = useRef<HTMLInputElement>(null); const loginRef = useRef<HTMLInputElement>(null);
const doLogin = useCallback(() => { const doLogin = useCallback(() => {
// Netuším proč mě TypeScript seřve když se to pokusím zchainovat dohromady const length = loginRef?.current?.value && loginRef?.current?.value.length && loginRef.current.value.replace(/\s/g, '').length
if (loginRef?.current?.value && loginRef?.current?.value.length > 0) { if (length) {
auth?.setLogin(loginRef.current.value); auth?.setLogin(loginRef.current.value);
} }
}, []); }, []);