Neumožnění použití pouze bílých znaků ve jménu
This commit is contained in:
parent
0771286ba1
commit
3df3bb9541
@ -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);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user