From 0a0dd4ee1b27391e58396f00d5fe0bbd803b0a29 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 8 Oct 2021 16:16:35 +0200 Subject: [PATCH] Fix crash when opening Identity Server detail from preference --- .../features/settings/VectorSettingsGeneralFragment.kt | 8 ++++++-- vector/src/main/res/xml/vector_settings_general.xml | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt index 51496d6eb0..1be0bb3f76 100644 --- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsGeneralFragment.kt @@ -176,8 +176,7 @@ class VectorSettingsGeneralFragment @Inject constructor( mPasswordPreference.isVisible = false } - val discoveryPreference = findPreference(VectorPreferences.SETTINGS_DISCOVERY_PREFERENCE_KEY)!! - discoveryPreference.onPreferenceClickListener = Preference.OnPreferenceClickListener { + val openDiscoveryScreenPreferenceClickListener = Preference.OnPreferenceClickListener { (requireActivity() as VectorSettingsActivity).navigateTo( DiscoverySettingsFragment::class.java, SettingsActivityPayload.DiscoverySettings().toMvRxBundle() @@ -185,6 +184,11 @@ class VectorSettingsGeneralFragment @Inject constructor( true } + val discoveryPreference = findPreference(VectorPreferences.SETTINGS_DISCOVERY_PREFERENCE_KEY)!! + discoveryPreference.onPreferenceClickListener = openDiscoveryScreenPreferenceClickListener + + mIdentityServerPreference.onPreferenceClickListener = openDiscoveryScreenPreferenceClickListener + // Advanced settings // user account diff --git a/vector/src/main/res/xml/vector_settings_general.xml b/vector/src/main/res/xml/vector_settings_general.xml index e5929d8933..30ef4337dc 100644 --- a/vector/src/main/res/xml/vector_settings_general.xml +++ b/vector/src/main/res/xml/vector_settings_general.xml @@ -87,7 +87,6 @@