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
@@ -148,6 +148,7 @@ function EditTransaction(props) {
const { id } = useParams();
const handleSubmit = (e) => {
if (loading) return;
setLoading(true);
setSuccess(false);
const data = { ...input, report_type: null, report_memo: '' };
@@ -199,6 +200,7 @@ function ReportTransaction(props) {
const handleCheck = (e, v) => setInput({ ...input, [v.name]: v.checked });
const handleSubmit = (e) => {
if (loading) return;
setLoading(true);
setSuccess(false);
requester('/transactions/'+id+'/report/', 'POST', token, input)