fix(reminders): properly parse relative reminders which don't have an amount

This commit is contained in:
kolaente 2023-06-10 18:54:39 +02:00
parent 5e4eb4a728
commit 098b5fa2b1
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 7 additions and 7 deletions

View File

@ -164,11 +164,8 @@ function updateDataAndMaybeClose(toggle) {
}
function formatReminder(reminder: TaskReminderModel) {
const period = secondsToPeriod(reminder.relativePeriod)
// TODO: 0 does not work
if (period.amount === 0) {
switch (reminder.relativeTo) {
case REMINDER_PERIOD_RELATIVE_TO_TYPES.DUEDATE:

View File

@ -12,6 +12,9 @@ export default class TaskReminderModel extends AbstractModel<ITaskReminder> impl
super()
this.assignData(data)
this.reminder = parseDateOrNull(data.reminder)
if (this.relativeTo === '') {
this.relativeTo = null
}
}
}