Commit d8d72f92 authored by Viktor De Pasquale's avatar Viktor De Pasquale

Fixed policy toggle being impossible to cancel

parent a30f5b17
...@@ -42,6 +42,11 @@ class SuperuserViewModel( ...@@ -42,6 +42,11 @@ class SuperuserViewModel(
init { init {
rxBus.register<PolicyEnableEvent>() rxBus.register<PolicyEnableEvent>()
.filter {
val isIgnored = it.item == ignoreNext
if (isIgnored) ignoreNext = null
!isIgnored
}
.subscribeK { togglePolicy(it.item, it.enable) } .subscribeK { togglePolicy(it.item, it.enable) }
.add() .add()
rxBus.register<PolicyUpdateEvent>() rxBus.register<PolicyUpdateEvent>()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment