fix(reminders): make sure an overdue reminder is sent when there is only one overdue task

This commit is contained in:
kolaente 2022-12-01 18:41:24 +01:00
parent 51911a8868
commit 1f2eb57602
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 3 deletions

View File

@ -140,9 +140,13 @@ func RegisterOverdueReminderCron() {
}
if len(ut.tasks) == 1 {
n = &UndoneTaskOverdueNotification{
User: ut.user,
Task: ut.tasks[0],
// We know there's only one entry in the map so this is actually O(1) and we can use it to get the
// first entry without knowing the key of it.
for _, t := range ut.tasks {
n = &UndoneTaskOverdueNotification{
User: ut.user,
Task: t,
}
}
}