From 3df3bb9541a71aada240537175445af672baf2db Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Fri, 2 Jun 2023 20:37:17 +0200 Subject: [PATCH] =?UTF-8?q?Neumo=C5=BEn=C4=9Bn=C3=AD=20pou=C5=BEit=C3=AD?= =?UTF-8?q?=20pouze=20b=C3=ADl=C3=BDch=20znak=C5=AF=20ve=20jm=C3=A9nu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/Login.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } }, []);