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 {
|
if len(ut.tasks) == 1 {
|
||||||
n = &UndoneTaskOverdueNotification{
|
// We know there's only one entry in the map so this is actually O(1) and we can use it to get the
|
||||||
User: ut.user,
|
// first entry without knowing the key of it.
|
||||||
Task: ut.tasks[0],
|
for _, t := range ut.tasks {
|
||||||
|
n = &UndoneTaskOverdueNotification{
|
||||||
|
User: ut.user,
|
||||||
|
Task: t,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user