Hide phone number settings for numberless accounts.

This commit is contained in:
Greyson Parrelli
2026-09-18 11:56:34 -04:00
parent e9dc1a01bb
commit 159a083ca4
3 changed files with 13 additions and 9 deletions
@@ -119,16 +119,18 @@ class PrivacySettingsFragment : DSLSettingsFragment(R.string.preferences__privac
private fun getConfiguration(state: PrivacySettingsState): DSLConfiguration {
return configure {
clickPref(
title = DSLSettingsText.from(R.string.preferences_app_protection__phone_number),
summary = DSLSettingsText.from(R.string.preferences_app_protection__choose_who_can_see),
onClick = {
Navigation.findNavController(requireView())
.safeNavigate(R.id.action_privacySettingsFragment_to_phoneNumberPrivacySettingsFragment)
}
)
if (state.hasPhoneNumber) {
clickPref(
title = DSLSettingsText.from(R.string.preferences_app_protection__phone_number),
summary = DSLSettingsText.from(R.string.preferences_app_protection__choose_who_can_see),
onClick = {
Navigation.findNavController(requireView())
.safeNavigate(R.id.action_privacySettingsFragment_to_phoneNumberPrivacySettingsFragment)
}
)
dividerPref()
dividerPref()
}
clickPref(
title = DSLSettingsText.from(R.string.PrivacySettingsFragment__blocked),
@@ -1,6 +1,7 @@
package org.thoughtcrime.securesms.components.settings.app.privacy
data class PrivacySettingsState(
val hasPhoneNumber: Boolean,
val blockedCount: Int,
val readReceipts: Boolean,
val typingIndicators: Boolean,
@@ -68,6 +68,7 @@ class PrivacySettingsViewModel(
private fun getState(): PrivacySettingsState {
return PrivacySettingsState(
hasPhoneNumber = !SignalStore.account.isPhoneNumberless,
blockedCount = 0,
readReceipts = TextSecurePreferences.isReadReceiptsEnabled(AppDependencies.application),
typingIndicators = TextSecurePreferences.isTypingIndicatorsEnabled(AppDependencies.application),