Fix small issue on the settings.

This commit is contained in:
Benoit Marty 2022-06-09 17:19:52 +02:00
parent 33911c880c
commit b1e062a204
2 changed files with 7 additions and 2 deletions

View File

@ -101,7 +101,11 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor(
findPreference<SwitchPreference>(VectorPreferences.SETTINGS_ENABLE_THIS_DEVICE_PREFERENCE_KEY)?.let {
it.setTransactionalSwitchChangeListener(lifecycleScope) { isChecked ->
if (isChecked) {
unifiedPushHelper.register(requireActivity())
unifiedPushHelper.register(requireActivity()) {
// Update the summary
findPreference<VectorPreference>(VectorPreferences.SETTINGS_UNIFIED_PUSH_RE_REGISTER_KEY)
?.summary = unifiedPushHelper.getCurrentDistributorName()
}
} else {
unifiedPushHelper.unregister(pushersManager)
session.pushersService().refreshPushers()

View File

@ -52,8 +52,9 @@
android:title="@string/settings_notification_configuration">
<im.vector.app.core.preference.VectorPreference
android:persistent="false"
android:dependency="SETTINGS_ENABLE_THIS_DEVICE_PREFERENCE_KEY"
android:key="SETTINGS_UNIFIED_PUSH_RE_REGISTER_KEY"
android:persistent="false"
android:title="@string/settings_unifiedpush_reregister" />
<!-- For API < 26 -->