Skip to content

Commit

Permalink
fixes initial highlihting of all reminders
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Peter committed Sep 2, 2024
1 parent 5fdfadd commit d5b5453
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit d5b5453

Please sign in to comment.