From 58f660ad7079f50e073a50b3ef91faa33a45efaf Mon Sep 17 00:00:00 2001 From: Dirk Peter Date: Mon, 2 Sep 2024 08:46:31 +0200 Subject: [PATCH] fises initial highlighthing of all reminders --- .../reminder-drawer.component.ts | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/app/reminder-plugin/components/reminder-drawer/reminder-drawer.component.ts b/src/app/reminder-plugin/components/reminder-drawer/reminder-drawer.component.ts index a31ed18..2f5c5fc 100644 --- a/src/app/reminder-plugin/components/reminder-drawer/reminder-drawer.component.ts +++ b/src/app/reminder-plugin/components/reminder-drawer/reminder-drawer.component.ts @@ -145,17 +145,18 @@ export class ReminderDrawerComponent implements OnDestroy { if (!this.reminders.length) return; // check if a reminder is new in a group - this.reminderGroups.forEach((group, index) => { - group.reminders.forEach((reminder) => { - if (!this._previousState[index]?.includes(reminder.id)) { - reminder.changed = true; - setTimeout( - () => delete reminder.changed, - REMINDER_HIGHLIGHT_DURATION_SECONDS * 1000 - ); - } + if (this._previousState.length) + this.reminderGroups.forEach((group, index) => { + group.reminders.forEach((reminder) => { + if (!this._previousState[index]?.includes(reminder.id)) { + reminder.changed = true; + setTimeout( + () => delete reminder.changed, + REMINDER_HIGHLIGHT_DURATION_SECONDS * 1000 + ); + } + }); }); - }); // store current state for future comparison this._previousState = this.reminderGroups.map((group) => {