Fix crash when opening Identity Server detail from preference

This commit is contained in:
Benoit Marty 2021-10-08 16:16:35 +02:00
parent bcf6342312
commit 0a0dd4ee1b
2 changed files with 6 additions and 3 deletions

View file

@ -176,8 +176,7 @@ class VectorSettingsGeneralFragment @Inject constructor(
mPasswordPreference.isVisible = false
}
val discoveryPreference = findPreference<VectorPreference>(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<VectorPreference>(VectorPreferences.SETTINGS_DISCOVERY_PREFERENCE_KEY)!!
discoveryPreference.onPreferenceClickListener = openDiscoveryScreenPreferenceClickListener
mIdentityServerPreference.onPreferenceClickListener = openDiscoveryScreenPreferenceClickListener
// Advanced settings
// user account

View file

@ -87,7 +87,6 @@
<im.vector.app.core.preference.VectorPreference
android:key="SETTINGS_IDENTITY_SERVER_PREFERENCE_KEY"
android:title="@string/settings_identity_server"
app:fragment="im.vector.app.features.discovery.DiscoverySettingsFragment"
tools:summary="https://identity.server.url" />
<im.vector.app.core.preference.VectorPreference