mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
Revert the check box in case of error
This commit is contained in:
parent
4261b0e78a
commit
937d497a1f
1 changed files with 5 additions and 2 deletions
|
@ -168,11 +168,14 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor(
|
||||||
pushManager.unregisterPusher(it, object : MatrixCallback<Unit> {
|
pushManager.unregisterPusher(it, object : MatrixCallback<Unit> {
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
session.refreshPushers()
|
session.refreshPushers()
|
||||||
super.onSuccess(data)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(failure: Throwable) {
|
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()
|
Toast.makeText(activity, R.string.unknown_error, Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue