Try to improve readability

This commit is contained in:
Benoit Marty 2020-07-11 13:19:43 +02:00
parent 352662d19a
commit 7193db8344
1 changed files with 34 additions and 39 deletions

View File

@ -129,15 +129,12 @@ class VectorSettingsSecurityPrivacyFragment @Inject constructor(
}
private fun refresh4SSection(info: SecretsSynchronisationInfo) {
secureBackupCategory.isVisible = false
// it's a lot of if / else if / else
// But it's not yet clear how to manage all cases
if (!info.isCrossSigningEnabled) {
// There is not cross signing, so we can remove the section
secureBackupCategory.isVisible = false
} else {
secureBackupCategory.isVisible = true
if (!info.isBackupSetup) {
if (info.isCrossSigningEnabled && info.allPrivateKeysKnown) {
// You can setup recovery!
@ -154,9 +151,7 @@ class VectorSettingsSecurityPrivacyFragment @Inject constructor(
// you should synchronize to get gossips
secureBackupCategory.isVisible = false
}
return
}
} else {
// so here we know that 4S is setup
if (info.isCrossSigningTrusted && info.allPrivateKeysKnown) {
// Looks like we have all cross signing secrets and session is trusted
@ -187,7 +182,6 @@ class VectorSettingsSecurityPrivacyFragment @Inject constructor(
} else {
secureBackupCategory.isVisible = false
}
return
} else {
// 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
@ -204,6 +198,7 @@ class VectorSettingsSecurityPrivacyFragment @Inject constructor(
}
}
}
}
override fun bindPref() {
// Push target