Disable buttons while loading
This commit is contained in:
parent
3b8e0097a1
commit
440d389f16
|
@ -541,6 +541,7 @@ export function AdminCert(props) {
|
|||
|
||||
const handleCert = (e) => {
|
||||
e.preventDefault();
|
||||
if (loading) return;
|
||||
setLoading(true);
|
||||
let data = Object();
|
||||
data[field] = moment.utc().tz('America/Edmonton').format('YYYY-MM-DD');
|
||||
|
@ -555,6 +556,7 @@ export function AdminCert(props) {
|
|||
|
||||
const handleUncert = (e) => {
|
||||
e.preventDefault();
|
||||
if (loading) return;
|
||||
setLoading(true);
|
||||
let data = Object();
|
||||
data[field] = null;
|
||||
|
|
|
@ -109,6 +109,7 @@ export function ClassDetail(props) {
|
|||
}, [refreshCount]);
|
||||
|
||||
const handleSignup = () => {
|
||||
if (loading) return;
|
||||
setLoading(true);
|
||||
const data = { attendance_status: 'Waiting for payment', session: id };
|
||||
requester('/training/', 'POST', token, data)
|
||||
|
@ -122,6 +123,7 @@ export function ClassDetail(props) {
|
|||
};
|
||||
|
||||
const handleToggle = (newStatus) => {
|
||||
if (loading) return;
|
||||
setLoading(true);
|
||||
const data = { attendance_status: newStatus, session: id };
|
||||
requester('/training/'+userTraining.id+'/', 'PUT', token, data)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user