Fetch all tasks to reschedule at once

pull/1178/head
Alex Baker 5 years ago
parent 5a60819fc7
commit b80f14cc21

@ -272,8 +272,9 @@ class DateTimePicker : BottomSheetDialogFragment() {
targetFragment?.onActivityResult(targetRequestCode, RESULT_OK, intent) targetFragment?.onActivityResult(targetRequestCode, RESULT_OK, intent)
} else { } else {
lifecycleScope.launch(NonCancellable) { lifecycleScope.launch(NonCancellable) {
taskIds.forEach { taskId -> taskDao
taskDao.fetch(taskId)?.let { .fetch(taskIds.toList())
.forEach {
it.setDueDateAdjustingHideUntil(when { it.setDueDateAdjustingHideUntil(when {
selectedDay == MULTIPLE_DAYS -> selectedDay == MULTIPLE_DAYS ->
it.dueDate.toDateTime().withMillisOfDay(selectedTime).millis it.dueDate.toDateTime().withMillisOfDay(selectedTime).millis
@ -288,7 +289,6 @@ class DateTimePicker : BottomSheetDialogFragment() {
} }
} }
} }
}
dismiss() dismiss()
} }

Loading…
Cancel
Save