diff --git a/src/lib/cache/cacheHelper.ts b/src/lib/cache/cacheHelper.ts index 6050490c..a17359a1 100644 --- a/src/lib/cache/cacheHelper.ts +++ b/src/lib/cache/cacheHelper.ts @@ -91,18 +91,16 @@ export function getAllTeachers(credentials: Credentials): string[] { return getAllEntities(credentials, PlanTypePlural.TEACHER); } -export function getAllInfos(credentials: Credentials): Array<{ info: string; date: Date }> { +export function getAllInfos(credentials: Credentials): { infos: string[]; date: Date }[] { const plans = getPlans(credentials.schoolnumber); - const infos: Array<{ info: string; date: Date }> = []; + const information: Array<{ infos: string[]; date: Date }> = []; plans.forEach((plan) => { if (plan.info) { - plan.info.forEach((info) => { - infos.push({ info, date: new Date(plan.date) }); - }); + information.push({ infos: plan.info, date: new Date(plan.date) }); } }); - infos.sort((a, b) => a.date.getTime() - b.date.getTime()); - return infos.filter((info) => info.date.getTime() >= new Date().setHours(0, 0, 0, 0)); + information.sort((a, b) => a.date.getTime() - b.date.getTime()); + return information.filter((info) => info.date.getTime() >= new Date().setHours(0, 0, 0, 0)); } function isLessonTimetableValid(lesson: PlannedLesson): boolean { diff --git a/src/lib/components/favorites/NextLessonWidget.svelte b/src/lib/components/favorites/NextLessonWidget.svelte index 057986c2..e835794c 100644 --- a/src/lib/components/favorites/NextLessonWidget.svelte +++ b/src/lib/components/favorites/NextLessonWidget.svelte @@ -40,7 +40,7 @@ {#if primary} -
+
{#if lessons.length !== 0} {#each lessons as lesson} {#key lesson.id} diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index be406384..1e7d2f50 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -49,25 +49,26 @@

{greeting}

-
+
{#if data.infos.length > 0}

Informationen

-
+
{#each data.infos as info}
-

{info.date.toLocaleDateString()}

-

{info.info}

+

{info.date.toLocaleDateString()}

+ +

{@html info.infos.join('
')}

{/each}
-
+
{/if} -
+

Deine Favoriten