changing some code to avoid ConcurrentModificationExceptions

This commit is contained in:
tibbi 2022-03-17 13:39:58 +01:00
parent 981c19850b
commit 7e7234d0bc

@ -191,20 +191,19 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
return
}
ensureBackgroundThread {
context?.let { ctx ->
note?.let { currentNote ->
if (refreshIndex != -1) {
view.checklist_list.post {
view.checklist_list.adapter?.notifyItemChanged(refreshIndex)
}
}
currentNote.value = getChecklistItems()
saveNoteValue(note!!, currentNote.value)
ctx.updateWidgets()
if (note != null) {
if (refreshIndex != -1) {
view.checklist_list.post {
view.checklist_list.adapter?.notifyItemChanged(refreshIndex)
}
}
note!!.value = getChecklistItems()
ensureBackgroundThread {
saveNoteValue(note!!, note!!.value)
context?.updateWidgets()
}
}
}