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