forked from GitHub-Mirror/riotX-android
Fix / register/unregister pusher
This commit is contained in:
parent
338de3ebf5
commit
fb7ada72dd
@ -87,11 +87,13 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment(
|
||||
FcmHelper.getFcmToken(requireContext())?.let {
|
||||
pushManager.unregisterPusher(it, object : MatrixCallback<Unit> {
|
||||
override fun onSuccess(data: Unit) {
|
||||
Matrix.getInstance().currentSession?.refreshPushers()
|
||||
super.onSuccess(data)
|
||||
}
|
||||
|
||||
override fun onFailure(failure: Throwable) {
|
||||
super.onFailure(failure)
|
||||
Matrix.getInstance().currentSession?.refreshPushers()
|
||||
Toast.makeText(activity, R.string.unknown_error, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -116,7 +118,7 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment(
|
||||
override fun onFailure(failure: Throwable) {
|
||||
//revert the check box
|
||||
switchPref.isChecked = !switchPref.isChecked
|
||||
Toast.makeText(requireContext(), R.string.unknown_error, Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(activity, R.string.unknown_error, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -33,7 +33,6 @@
|
||||
app:fragment="im.vector.fragments.VectorSettingsNotificationsAdvancedFragment" />
|
||||
|
||||
<im.vector.riotredesign.core.preference.VectorPreference
|
||||
android:dependency="SETTINGS_ENABLE_THIS_DEVICE_PREFERENCE_KEY"
|
||||
android:key="SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY"
|
||||
android:title="@string/settings_notification_troubleshoot"
|
||||
app:fragment="im.vector.riotredesign.features.settings.VectorSettingsNotificationsTroubleshootFragment" />
|
||||
|
Loading…
Reference in New Issue
Block a user