Update Context.kt

This commit is contained in:
Tibor Kaputa
2023-01-15 20:32:10 +01:00
committed by GitHub
parent 0725eabcb2
commit 54d0138b39

View File

@@ -713,16 +713,15 @@ fun Context.addImportIdsToTasks(callback: () -> Unit) {
ensureBackgroundThread { ensureBackgroundThread {
var count = 0 var count = 0
eventsDB.getAllTasks() eventsDB.getAllTasks().forEach { task ->
.forEach { task -> if (task.importId.isEmpty()) {
if (task.importId.isEmpty()) { eventsDB.updateTaskImportId(
eventsDB.updateTaskImportId( importId = generateImportId(),
importId = generateImportId(), id = task.id!!
id = task.id!! )
) count += 1
count += 1
}
} }
}
if (count > 0) { if (count > 0) {
callback() callback()