fix(reminders): make sure an overdue reminder is sent when there is only one overdue task
This commit is contained in:
parent
51911a8868
commit
1f2eb57602
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user