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