Disable buttons while loading

This commit is contained in:
2020-09-15 19:42:09 +00:00
parent 3b8e0097a1
commit 440d389f16
3 changed files with 5 additions and 0 deletions
+1
View File
@@ -71,6 +71,7 @@ function AttendanceRow(props) {
const [loading, setLoading] = useState(false);
const handleMark = (newStatus) => {
if (loading) return;
setLoading(newStatus);
const data = { ...student, attendance_status: newStatus };
requester('/training/'+student.id+'/', 'PATCH', token, data)