Avoid concurrency issues when reordering categories

Maybe fixes #8372
This commit is contained in:
arkon
2022-11-22 23:12:23 -05:00
parent 5c37347cec
commit e2179a6669
4 changed files with 53 additions and 37 deletions

View File

@@ -96,8 +96,7 @@ fun ChangeCategoryDialog(
val index = selection.indexOf(it)
if (index != -1) {
val mutableList = selection.toMutableList()
mutableList.removeAt(index)
mutableList.add(index, it.next())
mutableList[index] = it.next()
selection = mutableList.toList()
}
}

View File

@@ -64,8 +64,7 @@ fun DeleteLibraryMangaDialog(
val onCheck = {
val index = list.indexOf(state)
val mutableList = list.toMutableList()
mutableList.removeAt(index)
mutableList.add(index, state.next() as CheckboxState.State<Int>)
mutableList[index] = state.next() as CheckboxState.State<Int>
list = mutableList.toList()
}