changing some code to avoid ConcurrentModificationExceptions

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

View File

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