diff --git a/plugin/components/reminder-drawer/reminder-drawer.component.ts b/plugin/components/reminder-drawer/reminder-drawer.component.ts index fabd8ea..0a87462 100644 --- a/plugin/components/reminder-drawer/reminder-drawer.component.ts +++ b/plugin/components/reminder-drawer/reminder-drawer.component.ts @@ -129,15 +129,15 @@ export class ReminderDrawerComponent implements OnDestroy { clearTimeout(this.updateTimer); - if (!this.reminders.length) { - return; - } + if (!this.reminders.length) return; const closestReminder = sortBy( filter(this.reminders, (r) => r.status !== ReminderStatus.cleared && moment(r.time) > now), 'time' )[0]; + if (!closestReminder) return; + this.updateTimer = setTimeout(() => this.digestReminders(this.reminders), moment(closestReminder.time).diff(now)); } }