Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide deactivate account section in case of account managed externally. #8627

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8619.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hide account deactivation UI for account managed externally.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import im.vector.app.core.intent.getFilenameFromUri
import im.vector.app.core.platform.SimpleTextWatcher
import im.vector.app.core.preference.UserAvatarPreference
import im.vector.app.core.preference.VectorPreference
import im.vector.app.core.preference.VectorPreferenceCategory
import im.vector.app.core.preference.VectorSwitchPreference
import im.vector.app.core.utils.TextUtils
import im.vector.app.core.utils.getSizeOfFiles
Expand Down Expand Up @@ -110,6 +111,9 @@ class VectorSettingsGeneralFragment :
private val mExternalAccountManagementPreference by lazy {
findPreference<VectorPreference>(VectorPreferences.SETTINGS_EXTERNAL_ACCOUNT_MANAGEMENT_KEY)!!
}
private val mDeactivateAccountCategory by lazy {
findPreference<VectorPreferenceCategory>("SETTINGS_DEACTIVATE_ACCOUNT_CATEGORY_KEY")!!
}

// Local contacts
private val mContactSettingsCategory by lazy {
Expand Down Expand Up @@ -322,6 +326,8 @@ class VectorSettingsGeneralFragment :

false
}
// Account deactivation is visible only if account is not managed by an external URL.
hughns marked this conversation as resolved.
Show resolved Hide resolved
mDeactivateAccountCategory.isVisible = homeServerCapabilities.delegatedOidcAuthEnabled.not()
}

private suspend fun getCacheSize(): Long = withContext(Dispatchers.IO) {
Expand Down
4 changes: 3 additions & 1 deletion vector/src/main/res/xml/vector_settings_general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@

</im.vector.app.core.preference.VectorPreferenceCategory>

<im.vector.app.core.preference.VectorPreferenceCategory android:title="@string/settings_deactivate_account_section">
<im.vector.app.core.preference.VectorPreferenceCategory
android:key="SETTINGS_DEACTIVATE_ACCOUNT_CATEGORY_KEY"
android:title="@string/settings_deactivate_account_section">

<im.vector.app.core.preference.VectorPreference
android:key="SETTINGS_DEACTIVATE_ACCOUNT_KEY"
Expand Down
Loading