Compare commits

...

2 Commits

Author SHA1 Message Date
Daniel Perelman c6d8d64a41 Fix for viewing invalid person. 2022-08-24 03:21:57 -07:00
Daniel Perelman edaf988eec Fix for viewing invalid day. 2022-08-24 03:19:19 -07:00
1 changed files with 10 additions and 0 deletions

View File

@ -356,6 +356,13 @@ function displayFullSchedule() {
}
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) {
const grid = schedule.gridFor(person, hash.day);
const title = document.createElement('h1');
@ -446,6 +453,9 @@ async function refreshDisplay() {
function displaySchedule() {
utils.clearChildren(schedulesDiv);
if (hash.day && !schedule.all_days.includes(hash.day)) {
updateHash({day: undefined});
}
if (!hash.person) {
displayFullSchedule();
} else if (hash.person.kind) {