Update timestamp on edits

Fix bugs introduced by 775289b05
pull/2604/head
Alex Baker 7 months ago
parent 2545832d67
commit b477623524

@ -112,7 +112,7 @@ class CaldavDaoShiftTests : InjectingTestCase() {
fun ignoreDeletedTasksWhenShiftingDown() = runBlocking {
val created = DateTime(2020, 5, 17, 9, 53, 17)
addTask(with(CREATED, created))
taskDao.update(taskDao.fetch(tasks[0].id).apply { this?.deletionDate = now() }!!)
taskDao.update(taskDao.fetch(tasks[0].id).apply { this?.deletionDate = now() }!!, null)
caldavDao.shiftDown("calendar", 0, created.toAppleEpoch())

@ -443,6 +443,6 @@ open class TaskAdapter(
task.parent = newParent
}
caldavDao.update(caldavTask.id, caldavTask.remoteParent)
taskDao.save(task.task, null)
taskDao.save(task.task)
}
}

@ -114,7 +114,7 @@ class TaskCreator @Inject constructor(
locationDao.insert(Geofence(place.uid, preferences))
}
}
taskDao.save(task, null)
taskDao.save(task)
alarmDao.insert(task.getDefaultAlarms())
return task
}

@ -99,7 +99,7 @@ class TaskDuplicator @Inject constructor(
alarmDao.insert(alarms.map { Alarm(clone.id, it.time, it.type) })
}
gcalHelper.createTaskEventIfEnabled(clone)
taskDao.save(clone, null) // TODO: delete me
taskDao.save(clone) // TODO: delete me
taskAttachmentDao
.getAttachmentsForTask(originalId)
.map {

@ -55,7 +55,7 @@ class TimerPlugin @Inject constructor(
task.elapsedSeconds = task.elapsedSeconds + newElapsed
}
}
taskDao.update(task)
taskDao.update(task, taskDao.fetch(task.id))
updateNotifications()
}

@ -188,7 +188,7 @@ FROM recursive_tasks
@Insert
abstract suspend fun insert(task: Task): Long
suspend fun update(task: Task, original: Task? = null): Task =
suspend fun update(task: Task, original: Task?): Task =
task
.copy(
modificationDate = when {

@ -300,7 +300,7 @@ class TaskEditViewModel @Inject constructor(
selectedAlarms.value = selectedAlarms.value.filterNot { a -> a.type == TYPE_REL_END }
}
taskDao.save(task, null)
taskDao.save(task)
if (isNew || originalList != selectedList.value) {
task.parent = 0

Loading…
Cancel
Save