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
@@ -79,6 +79,7 @@ export function InstructorCourseDetail(props) {
const { id } = useParams();
const handleSubmit = (e) => {
if (loading) return;
setLoading(true);
setSuccess(false);
const data = { ...input, is_old: false };
@@ -131,6 +132,7 @@ export function InstructorCourseList(props) {
const [success, setSuccess] = useState(false);
const handleSubmit = (e) => {
if (loading) return;
setLoading(true);
setSuccess(false);
const data = { ...input, is_old: false };