Prevent form submit if loading

This commit is contained in:
2020-02-04 07:18:29 +00:00
parent 1ebb1f64ad
commit ee520b8c3f
6 changed files with 17 additions and 0 deletions
+2
View File
@@ -13,6 +13,7 @@ export function LoginForm(props) {
const handleChange = (e) => handleValues(e, e.currentTarget);
const handleSubmit = (e) => {
if (loading) return;
setLoading(true);
const data = { ...input, username: input.username.toLowerCase() };
requester('/rest-auth/login/', 'POST', '', data)
@@ -68,6 +69,7 @@ export function SignupForm(props) {
);
const handleSubmit = (e) => {
if (loading) return;
setLoading(true);
input.username = genUsername();
requester('/registration/', 'POST', '', input)