Archived
Private
Public Access
1
0

fixed timing issue

This commit is contained in:
2023-09-11 08:39:30 +02:00
parent 80ba0dc027
commit fcfb0cbf88

View File

@@ -39,10 +39,10 @@ export class HomePage implements OnInit {
this.dayName = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"][this.today.getDay()]; this.dayName = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"][this.today.getDay()];
const scheduleDay = [undefined, "mon", "tue", "wed", "thu", "fri", undefined][this.today.getDay()]; const scheduleDay = [undefined, "mon", "tue", "wed", "thu", "fri", undefined][this.today.getDay()];
const mailPromise = this.mails.getMails("INBOX", 0);
const classPromise = this.iserv.getCoursesAndClass(); const classPromise = this.iserv.getCoursesAndClass();
const subsPromise = this.units.getSubstitutionPlan("today"); const subsPromise = this.units.getSubstitutionPlan("today");
const timetablePromise = this.storage.getItem<Timetable>("timetable"); const timetablePromise = this.storage.getItem<Timetable>("timetable");
const mailPromise = this.mails.getMails("INBOX", 0);
await Promise.all([classPromise, subsPromise, timetablePromise]); await Promise.all([classPromise, subsPromise, timetablePromise]);
this.classData = await classPromise; this.classData = await classPromise;
@@ -60,7 +60,7 @@ export class HomePage implements OnInit {
this.subs = unitsData.substitutions?.filter(subs => subs.classes.includes(this.classData.class)); this.subs = unitsData.substitutions?.filter(subs => subs.classes.includes(this.classData.class));
this.subsDate = unitsData.date; this.subsDate = unitsData.date;
if (this.classData.class.startsWith("Q")) { if (this.classData.class?.startsWith("Q")) {
this.subs = this.subs.filter(subs => this.classData.courses.filter(course => course.id == subs.lesson.replace("1", "").replace("2", "")).length > 0); this.subs = this.subs.filter(subs => this.classData.courses.filter(course => course.id == subs.lesson.replace("1", "").replace("2", "")).length > 0);
} }