mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 20:15:29 +00:00
Fixed snackbar for changed su states being incorrect
This commit is contained in:
parent
125ae0a173
commit
0e6c205732
@ -86,13 +86,14 @@ class SuperuserViewModel(
|
||||
|
||||
private fun updatePolicy(it: PolicyUpdateEvent) = when (it) {
|
||||
is PolicyUpdateEvent.Notification -> updatePolicy(it.item.item.copy(notification = it.shouldNotify)) {
|
||||
val textId = if (it.logging) R.string.su_snack_notif_on else R.string.su_snack_notif_off
|
||||
val textId =
|
||||
if (it.notification) R.string.su_snack_notif_on else R.string.su_snack_notif_off
|
||||
val text = resources.getString(textId).format(it.appName)
|
||||
SnackbarEvent(text).publish()
|
||||
}
|
||||
is PolicyUpdateEvent.Log -> updatePolicy(it.item.item.copy(logging = it.shouldLog)) {
|
||||
val textId =
|
||||
if (it.notification) R.string.su_snack_log_on else R.string.su_snack_log_off
|
||||
if (it.logging) R.string.su_snack_log_on else R.string.su_snack_log_off
|
||||
val text = resources.getString(textId).format(it.appName)
|
||||
SnackbarEvent(text).publish()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user