forked from vikunja/app
Remove all reminders with no value
This commit is contained in:
parent
b6b113c106
commit
98b518df9d
|
@ -224,8 +224,10 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
|||
|
||||
_saveTask(BuildContext context) async {
|
||||
setState(() => _loading = true);
|
||||
// FIXME: is there a way we can update the task without creating a new task object?
|
||||
// aka updating the existing task we got from context (setters?)
|
||||
|
||||
// Removes all reminders with no value set.
|
||||
_reminderDates.removeWhere((d) => d == null);
|
||||
|
||||
Task updatedTask = Task(
|
||||
id: widget.task.id,
|
||||
text: _text,
|
||||
|
@ -257,17 +259,4 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
|||
);
|
||||
});
|
||||
}
|
||||
|
||||
_reminderDatesInput() {
|
||||
_reminderDates = widget.task.reminderDates;
|
||||
|
||||
_reminderDates?.asMap()?.forEach(
|
||||
(i, time) => setState(() => _reminderInputs?.add(VikunjaDateTimePicker(
|
||||
initialValue: time,
|
||||
label: 'Reminder',
|
||||
onSaved: (reminder) => _reminderDates[i] = reminder,
|
||||
))));
|
||||
|
||||
//return _reminderInputs;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user