Redukce zbytečných pokusů o příhlášení
This commit is contained in:
parent
700a6980ca
commit
5379c21203
@ -12,6 +12,7 @@ export default function Login() {
|
|||||||
const loginRef = useRef<HTMLInputElement>(null);
|
const loginRef = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (auth && !auth.login) {
|
||||||
// Vyzkoušíme přihlášení "naprázdno", pokud projde, přihlásili nás trusted headers
|
// Vyzkoušíme přihlášení "naprázdno", pokud projde, přihlásili nás trusted headers
|
||||||
login().then(token => {
|
login().then(token => {
|
||||||
if (token) {
|
if (token) {
|
||||||
@ -20,7 +21,8 @@ export default function Login() {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
// nezajímá nás
|
// nezajímá nás
|
||||||
});
|
});
|
||||||
}, []);
|
}
|
||||||
|
}, [auth]);
|
||||||
|
|
||||||
const doLogin = useCallback(async () => {
|
const doLogin = useCallback(async () => {
|
||||||
const length = loginRef?.current?.value && loginRef?.current?.value.length && loginRef.current.value.replace(/\s/g, '').length
|
const length = loginRef?.current?.value && loginRef?.current?.value.length && loginRef.current.value.replace(/\s/g, '').length
|
||||||
|
Loading…
x
Reference in New Issue
Block a user