mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-19 16:24:41 +01:00
Hide phone number settings for numberless accounts.
This commit is contained in:
+11
-9
@@ -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
@@ -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,
|
||||
|
||||
+1
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user