Revert the check box in case of error
This commit is contained in:
parent
4261b0e78a
commit
937d497a1f
|
@ -168,11 +168,14 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor(
|
|||
pushManager.unregisterPusher(it, object : MatrixCallback<Unit> {
|
||||
override fun onSuccess(data: Unit) {
|
||||
session.refreshPushers()
|
||||
super.onSuccess(data)
|
||||
}
|
||||
|
||||
override fun onFailure(failure: Throwable) {
|
||||
session.refreshPushers()
|
||||
if (!isAdded) {
|
||||
return
|
||||
}
|
||||
// revert the check box
|
||||
switchPref.isChecked = !switchPref.isChecked
|
||||
Toast.makeText(activity, R.string.unknown_error, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue