Client:OAuth2: fix form validation

This commit is contained in:
Timofey Boyko 2023-11-29 11:55:45 +03:00
parent f6f8f67757
commit fa4a1c5213

View File

@ -208,11 +208,11 @@ const ClientForm = ({
) {
isValid = false;
nameTimer.current = setTimeout(() => {
return (nameTimer.current = setTimeout(() => {
setErrorFields((value) => {
return [...value, key];
});
}, 300);
}, 300));
}
if (
@ -224,8 +224,12 @@ const ClientForm = ({
});
if (nameTimer.current) clearTimeout(nameTimer.current);
nameTimer.current = null;
return;
}
isValid = !errorFields.includes(key);
break;
}
}
@ -271,6 +275,8 @@ const ClientForm = ({
nameTimer.current = null;
}
isValid = errorFields.includes(key);
break;
case "logo":
isValid = isValid && !!form[key];