mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 04:29:18 +01:00
Fix crash when editing categories for global update or downloads
Fixes #949
This commit is contained in:
parent
372830b6d4
commit
1ce5f50d89
@ -60,16 +60,10 @@ internal class QuadStateMultiChoiceDialogAdapter(
|
||||
else -> QuadStateCheckBox.State.CHECKED.ordinal
|
||||
}
|
||||
currentSelection = newSelection.toIntArray()
|
||||
val selectedItems = this.items.pullIndices(this.currentSelection)
|
||||
selection?.invoke(dialog, currentSelection, selectedItems)
|
||||
}
|
||||
|
||||
internal inline fun <reified T> List<T>.pullIndices(indices: IntArray): List<T> {
|
||||
return mutableListOf<T>().apply {
|
||||
for (index in indices) {
|
||||
add(this@pullIndices[index])
|
||||
}
|
||||
val selectedItems = this.items.filterIndexed { index, _ ->
|
||||
currentSelection[index] != 0
|
||||
}
|
||||
selection?.invoke(dialog, currentSelection, selectedItems)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(
|
||||
|
Loading…
Reference in New Issue
Block a user