mobile: hide full delete preferences (#1438)

This commit is contained in:
JRoberts 2022-11-26 12:51:56 +04:00 committed by GitHub
parent 9c06acd4bc
commit 336a170b3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 18 deletions

View file

@ -72,11 +72,11 @@ private fun ContactPreferencesLayout(
horizontalAlignment = Alignment.Start, horizontalAlignment = Alignment.Start,
) { ) {
AppBarTitle(stringResource(R.string.contact_preferences)) AppBarTitle(stringResource(R.string.contact_preferences))
val allowFullDeletion: MutableState<ContactFeatureAllowed> = remember(featuresAllowed) { mutableStateOf(featuresAllowed.fullDelete) } // val allowFullDeletion: MutableState<ContactFeatureAllowed> = remember(featuresAllowed) { mutableStateOf(featuresAllowed.fullDelete) }
FeatureSection(Feature.FullDelete, user.fullPreferences.fullDelete.allow, contact.mergedPreferences.fullDelete, allowFullDeletion) { // FeatureSection(Feature.FullDelete, user.fullPreferences.fullDelete.allow, contact.mergedPreferences.fullDelete, allowFullDeletion) {
applyPrefs(featuresAllowed.copy(fullDelete = it)) // applyPrefs(featuresAllowed.copy(fullDelete = it))
} // }
SectionSpacer() // SectionSpacer()
val allowVoice: MutableState<ContactFeatureAllowed> = remember(featuresAllowed) { mutableStateOf(featuresAllowed.voice) } val allowVoice: MutableState<ContactFeatureAllowed> = remember(featuresAllowed) { mutableStateOf(featuresAllowed.voice) }
FeatureSection(Feature.Voice, user.fullPreferences.voice.allow, contact.mergedPreferences.voice, allowVoice) { FeatureSection(Feature.Voice, user.fullPreferences.voice.allow, contact.mergedPreferences.voice, allowVoice) {
applyPrefs(featuresAllowed.copy(voice = it)) applyPrefs(featuresAllowed.copy(voice = it))

View file

@ -60,11 +60,11 @@ private fun GroupPreferencesLayout(
horizontalAlignment = Alignment.Start, horizontalAlignment = Alignment.Start,
) { ) {
AppBarTitle(stringResource(R.string.group_preferences)) AppBarTitle(stringResource(R.string.group_preferences))
val allowFullDeletion = remember(preferences) { mutableStateOf(preferences.fullDelete.enable) } // val allowFullDeletion = remember(preferences) { mutableStateOf(preferences.fullDelete.enable) }
FeatureSection(Feature.FullDelete, allowFullDeletion, groupInfo) { // FeatureSection(Feature.FullDelete, allowFullDeletion, groupInfo) {
applyPrefs(preferences.copy(fullDelete = GroupPreference(enable = it))) // applyPrefs(preferences.copy(fullDelete = GroupPreference(enable = it)))
} // }
SectionSpacer() // SectionSpacer()
val allowVoice = remember(preferences) { mutableStateOf(preferences.voice.enable) } val allowVoice = remember(preferences) { mutableStateOf(preferences.voice.enable) }
FeatureSection(Feature.Voice, allowVoice, groupInfo) { FeatureSection(Feature.Voice, allowVoice, groupInfo) {
applyPrefs(preferences.copy(voice = GroupPreference(enable = it))) applyPrefs(preferences.copy(voice = GroupPreference(enable = it)))

View file

@ -61,11 +61,11 @@ private fun PreferencesLayout(
horizontalAlignment = Alignment.Start, horizontalAlignment = Alignment.Start,
) { ) {
AppBarTitle(stringResource(R.string.your_preferences)) AppBarTitle(stringResource(R.string.your_preferences))
val allowFullDeletion = remember(preferences) { mutableStateOf(preferences.fullDelete.allow) } // val allowFullDeletion = remember(preferences) { mutableStateOf(preferences.fullDelete.allow) }
FeatureSection(Feature.FullDelete, allowFullDeletion) { // FeatureSection(Feature.FullDelete, allowFullDeletion) {
applyPrefs(preferences.copy(fullDelete = ChatPreference(allow = it))) // applyPrefs(preferences.copy(fullDelete = ChatPreference(allow = it)))
} // }
SectionSpacer() // SectionSpacer()
val allowVoice = remember(preferences) { mutableStateOf(preferences.voice.allow) } val allowVoice = remember(preferences) { mutableStateOf(preferences.voice.allow) }
FeatureSection(Feature.Voice, allowVoice) { FeatureSection(Feature.Voice, allowVoice) {
applyPrefs(preferences.copy(voice = ChatPreference(allow = it))) applyPrefs(preferences.copy(voice = ChatPreference(allow = it)))

View file

@ -20,7 +20,7 @@ struct ContactPreferencesView: View {
VStack { VStack {
List { List {
featureSection(.fullDelete, user.fullPreferences.fullDelete.allow, contact.mergedPreferences.fullDelete, $featuresAllowed.fullDelete) // featureSection(.fullDelete, user.fullPreferences.fullDelete.allow, contact.mergedPreferences.fullDelete, $featuresAllowed.fullDelete)
featureSection(.voice, user.fullPreferences.voice.allow, contact.mergedPreferences.voice, $featuresAllowed.voice) featureSection(.voice, user.fullPreferences.voice.allow, contact.mergedPreferences.voice, $featuresAllowed.voice)
Section { Section {

View file

@ -18,7 +18,7 @@ struct GroupPreferencesView: View {
var body: some View { var body: some View {
VStack { VStack {
List { List {
featureSection(.fullDelete, $preferences.fullDelete.enable) // featureSection(.fullDelete, $preferences.fullDelete.enable)
featureSection(.voice, $preferences.voice.enable) featureSection(.voice, $preferences.voice.enable)
if groupInfo.canEdit { if groupInfo.canEdit {

View file

@ -18,7 +18,7 @@ struct PreferencesView: View {
var body: some View { var body: some View {
VStack { VStack {
List { List {
featureSection(.fullDelete, $preferences.fullDelete.allow) // featureSection(.fullDelete, $preferences.fullDelete.allow)
featureSection(.voice, $preferences.voice.allow) featureSection(.voice, $preferences.voice.allow)
Section { Section {