Fixed policy toggle being impossible to cancel

This commit is contained in:
Viktor De Pasquale 2019-11-01 14:47:59 +01:00
parent a30f5b175f
commit d8d72f92b3

View File

@ -42,6 +42,11 @@ class SuperuserViewModel(
init {
rxBus.register<PolicyEnableEvent>()
.filter {
val isIgnored = it.item == ignoreNext
if (isIgnored) ignoreNext = null
!isIgnored
}
.subscribeK { togglePolicy(it.item, it.enable) }
.add()
rxBus.register<PolicyUpdateEvent>()