From 22959cddb2507c98277d9b57bab30a1400be61fd Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Sat, 11 Jul 2020 13:24:10 +0200 Subject: [PATCH] Pref is always visible and enabled --- .../VectorSettingsSecurityPrivacyFragment.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsSecurityPrivacyFragment.kt b/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsSecurityPrivacyFragment.kt index 1dc314be08..d8f8546e2d 100644 --- a/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsSecurityPrivacyFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsSecurityPrivacyFragment.kt @@ -43,7 +43,6 @@ import im.vector.riotx.core.intent.ExternalIntentData import im.vector.riotx.core.intent.analyseIntent import im.vector.riotx.core.intent.getFilenameFromUri import im.vector.riotx.core.platform.SimpleTextWatcher -import im.vector.riotx.core.platform.VectorBaseActivity import im.vector.riotx.core.preference.VectorPreference import im.vector.riotx.core.preference.VectorPreferenceCategory import im.vector.riotx.core.utils.openFileSelection @@ -139,9 +138,7 @@ class VectorSettingsSecurityPrivacyFragment @Inject constructor( if (info.isCrossSigningEnabled && info.allPrivateKeysKnown) { // You can setup recovery! secureBackupCategory.isVisible = true - secureBackupPreference.isVisible = true secureBackupPreference.title = getString(R.string.settings_secure_backup_setup) - secureBackupPreference.isEnabled = true secureBackupPreference.onPreferenceClickListener = Preference.OnPreferenceClickListener { BootstrapBottomSheet.show(parentFragmentManager, initCrossSigningOnly = false, forceReset4S = false) true @@ -160,7 +157,6 @@ class VectorSettingsSecurityPrivacyFragment @Inject constructor( // Only option here is to create a new backup if you want? // aka reset secureBackupCategory.isVisible = true - secureBackupPreference.isVisible = true secureBackupPreference.title = getString(R.string.settings_secure_backup_reset) secureBackupPreference.onPreferenceClickListener = Preference.OnPreferenceClickListener { BootstrapBottomSheet.show(parentFragmentManager, initCrossSigningOnly = false, forceReset4S = true) @@ -170,11 +166,9 @@ class VectorSettingsSecurityPrivacyFragment @Inject constructor( // megolm backup is available but we don't have key // you could try to synchronize to get missing megolm key ? secureBackupCategory.isVisible = true - secureBackupPreference.isVisible = true secureBackupPreference.title = getString(R.string.settings_secure_backup_enter_to_setup) - secureBackupPreference.isEnabled = true secureBackupPreference.onPreferenceClickListener = Preference.OnPreferenceClickListener { - (requireActivity() as? VectorBaseActivity)?.let { + vectorActivity.let { it.navigator.requestSelfSessionVerification(it) } true @@ -186,11 +180,9 @@ class VectorSettingsSecurityPrivacyFragment @Inject constructor( // there is a backup, but this session is not trusted, or is missing some secrets // you should enter passphrase to get them or verify against another session secureBackupCategory.isVisible = true - secureBackupPreference.isVisible = true secureBackupPreference.title = getString(R.string.settings_secure_backup_enter_to_setup) - secureBackupPreference.isEnabled = true secureBackupPreference.onPreferenceClickListener = Preference.OnPreferenceClickListener { - (requireActivity() as? VectorBaseActivity)?.let { + vectorActivity.let { it.navigator.requestSelfSessionVerification(it) } true