diff --git a/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsNotificationFragment.kt b/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsNotificationFragment.kt index 925e5bc9..746a8fae 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsNotificationFragment.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsNotificationFragment.kt @@ -87,11 +87,13 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment( FcmHelper.getFcmToken(requireContext())?.let { pushManager.unregisterPusher(it, object : MatrixCallback { 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() } }) } diff --git a/vector/src/main/res/xml/vector_settings_notifications.xml b/vector/src/main/res/xml/vector_settings_notifications.xml index 7ae600f6..7ed78c07 100644 --- a/vector/src/main/res/xml/vector_settings_notifications.xml +++ b/vector/src/main/res/xml/vector_settings_notifications.xml @@ -33,7 +33,6 @@ app:fragment="im.vector.fragments.VectorSettingsNotificationsAdvancedFragment" />