From f1ec42c00e3672512ea6fc3fa4ab6503fef4546e Mon Sep 17 00:00:00 2001 From: "leon.hoppe" Date: Wed, 17 May 2023 18:53:31 +0200 Subject: [PATCH] improved loading performance --- BetterIServ.Mobile/src/app/pages/home/home.page.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BetterIServ.Mobile/src/app/pages/home/home.page.ts b/BetterIServ.Mobile/src/app/pages/home/home.page.ts index 7a645aa..70199f3 100644 --- a/BetterIServ.Mobile/src/app/pages/home/home.page.ts +++ b/BetterIServ.Mobile/src/app/pages/home/home.page.ts @@ -42,9 +42,8 @@ export class HomePage implements OnInit { const classPromise = this.iserv.getCoursesAndClass(); const subsPromise = this.units.getSubstitutionPlan("today"); const timetablePromise = this.storage.getItem("timetable"); - await Promise.all([mailPromise, classPromise, subsPromise, timetablePromise]); + await Promise.all([classPromise, subsPromise, timetablePromise]); - this.unreadMails = (await mailPromise).filter(mail => !mail.read); this.classData = await classPromise; let unitsData = await subsPromise; const timetable = await timetablePromise; @@ -62,6 +61,8 @@ export class HomePage implements OnInit { if (this.classData.class.startsWith("Q")) { this.subs = this.subs.filter(subs => this.classData.courses.filter(course => course.id == subs.lesson).length > 0); } + + this.unreadMails = (await mailPromise).filter(mail => !mail.read); } private dateIsPast(first: Date, second: Date): boolean {