hide e2e options after removing local e2e setup

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2022-11-18 15:21:11 +01:00
parent b110735dcc
commit f49252c87e
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -447,7 +447,9 @@ public class SettingsActivity extends PreferenceActivity
Preference preference = findPreference("setup_e2e_keys_exist");
if (preference != null) {
if (!CapabilityUtils.getCapability(this).getEndToEndEncryptionKeysExist().isTrue()) {
if (!CapabilityUtils.getCapability(this).getEndToEndEncryptionKeysExist().isTrue() ||
(CapabilityUtils.getCapability(this).getEndToEndEncryptionKeysExist().isTrue() &&
FileOperationsHelper.isEndToEndEncryptionSetup(this, user))) {
preferenceCategoryMore.removePreference(preference);
} else {
preference.setOnPreferenceClickListener(p -> {
@ -501,10 +503,14 @@ public class SettingsActivity extends PreferenceActivity
.setCancelable(true)
.setNegativeButton(R.string.common_cancel, ((dialog, i) -> dialog.dismiss()))
.setPositiveButton(R.string.confirm_removal, (dialog, which) -> {
// do something
EncryptionUtils.removeE2E(arbitraryDataProvider, user);
preferenceCategoryMore.removePreference(preference);
Preference pMnemonic = findPreference("mnemonic");
if (pMnemonic != null) {
preferenceCategoryMore.removePreference(pMnemonic);
}
dialog.dismiss();
})
.create();