Fixed items in superuser not disappearing when deleted

This commit is contained in:
Viktor De Pasquale 2019-04-26 21:29:13 +02:00
parent 7640246255
commit 52eb059515

View File

@ -62,7 +62,10 @@ class SuperuserViewModel(
fun deletePressed(item: PolicyRvItem) { fun deletePressed(item: PolicyRvItem) {
fun updateState() = deletePolicy(item.item) fun updateState() = deletePolicy(item.item)
.subscribeK { items.remove(item) } .map { items.filterIsInstance<PolicyRvItem>().toMutableList() }
.map { it.removeAll { it.item.packageName == item.item.packageName }; it }
.map { it to items.calculateDiff(it) }
.subscribeK { items.update(it.first, it.second) }
.add() .add()
withView { withView {