Compare commits

..

2 Commits

Author SHA1 Message Date
c6d8d64a41 Fix for viewing invalid person. 2022-08-24 03:21:57 -07:00
edaf988eec Fix for viewing invalid day. 2022-08-24 03:19:19 -07:00

View File

@ -356,6 +356,13 @@ function displayFullSchedule() {
} }
function displayIndividualSchedule(person) { function displayIndividualSchedule(person) {
if (person.kind === 'staff' && !schedule.all_staff.includes(person.name)
|| person.kind === 'student' && !schedule.all_students.includes(person.name)) {
updateHash({person: undefined});
displaySchedule();
return;
}
if (hash.day) { if (hash.day) {
const grid = schedule.gridFor(person, hash.day); const grid = schedule.gridFor(person, hash.day);
const title = document.createElement('h1'); const title = document.createElement('h1');
@ -446,6 +453,9 @@ async function refreshDisplay() {
function displaySchedule() { function displaySchedule() {
utils.clearChildren(schedulesDiv); utils.clearChildren(schedulesDiv);
if (hash.day && !schedule.all_days.includes(hash.day)) {
updateHash({day: undefined});
}
if (!hash.person) { if (!hash.person) {
displayFullSchedule(); displayFullSchedule();
} else if (hash.person.kind) { } else if (hash.person.kind) {