Delete Location Sharing feature flags (#1358)

* Delete location sharing feature flags

* Add changelog.d file

* Update localizations

* Amend changelog file
This commit is contained in:
Alfonso Grillo
2023-07-19 12:15:26 +02:00
committed by GitHub
parent cf39710891
commit df58d8378e
9 changed files with 19 additions and 54 deletions
@@ -29,8 +29,6 @@ struct DeveloperOptionsScreenViewStateBindings {
var userSuggestionsEnabled: Bool
var readReceiptsEnabled: Bool
var isEncryptionSyncEnabled: Bool
var locationEventsEnabled: Bool
var shareLocationEnabled: Bool
var notificationSettingsEnabled: Bool
var timelineDiffableAnimationsEnabled: Bool
}
@@ -40,8 +38,6 @@ enum DeveloperOptionsScreenViewAction {
case changedUserSuggestionsEnabled
case changedReadReceiptsEnabled
case changedIsEncryptionSyncEnabled
case changedLocationEventsEnabled
case changedShareLocationEnabled
case changedNotificationSettingsEnabled
case changedTimelineDiffableAnimationsEnabled
case clearCache
@@ -30,8 +30,6 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
userSuggestionsEnabled: appSettings.userSuggestionsEnabled,
readReceiptsEnabled: appSettings.readReceiptsEnabled,
isEncryptionSyncEnabled: appSettings.isEncryptionSyncEnabled,
locationEventsEnabled: appSettings.locationEventsEnabled,
shareLocationEnabled: appSettings.shareLocationEnabled,
notificationSettingsEnabled: appSettings.notificationSettingsEnabled,
timelineDiffableAnimationsEnabled: appSettings.timelineDiffableAnimationsEnabled)
let state = DeveloperOptionsScreenViewState(bindings: bindings)
@@ -53,10 +51,6 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
appSettings.readReceiptsEnabled = state.bindings.readReceiptsEnabled
case .changedIsEncryptionSyncEnabled:
appSettings.isEncryptionSyncEnabled = state.bindings.isEncryptionSyncEnabled
case .changedLocationEventsEnabled:
appSettings.locationEventsEnabled = state.bindings.locationEventsEnabled
case .changedShareLocationEnabled:
appSettings.shareLocationEnabled = state.bindings.shareLocationEnabled
case .changedNotificationSettingsEnabled:
appSettings.notificationSettingsEnabled = state.bindings.notificationSettingsEnabled
case .changedTimelineDiffableAnimationsEnabled:
@@ -19,7 +19,7 @@ import SwiftUI
struct DeveloperOptionsScreen: View {
@ObservedObject var context: DeveloperOptionsScreenViewModel.Context
@State private var showConfetti = false
var body: some View {
Form {
Section("Timeline") {
@@ -38,7 +38,7 @@ struct DeveloperOptionsScreen: View {
context.send(viewAction: .changedReadReceiptsEnabled)
}
}
Section("Notifications") {
Toggle(isOn: $context.isEncryptionSyncEnabled) {
Text("Use notification encryption sync")
@@ -55,23 +55,7 @@ struct DeveloperOptionsScreen: View {
context.send(viewAction: .changedNotificationSettingsEnabled)
}
}
Section("Location sharing") {
Toggle(isOn: $context.locationEventsEnabled) {
Text("Location events in timeline")
}
.onChange(of: context.locationEventsEnabled) { _ in
context.send(viewAction: .changedLocationEventsEnabled)
}
Toggle(isOn: $context.shareLocationEnabled) {
Text("Show share location action")
}
.onChange(of: context.shareLocationEnabled) { _ in
context.send(viewAction: .changedShareLocationEnabled)
}
}
Section("Room creation") {
Toggle(isOn: $context.userSuggestionsEnabled) {
Text("User suggestions")
@@ -87,7 +71,7 @@ struct DeveloperOptionsScreen: View {
context.send(viewAction: .changedTimelineDiffableAnimationsEnabled)
}
}
Section {
Button {
showConfetti = true
@@ -104,7 +88,7 @@ struct DeveloperOptionsScreen: View {
.frame(maxWidth: .infinity)
}
}
Section {
Button(role: .destructive) {
context.send(viewAction: .clearCache)
@@ -119,7 +103,7 @@ struct DeveloperOptionsScreen: View {
.navigationTitle(L10n.commonDeveloperOptions)
.navigationBarTitleDisplayMode(.inline)
}
@ViewBuilder
private var effectsView: some View {
if showConfetti {
@@ -129,7 +113,7 @@ struct DeveloperOptionsScreen: View {
.task { await removeConfettiAfterDelay() }
}
}
private func removeConfettiAfterDelay() async {
try? await Task.sleep(for: .seconds(4))
showConfetti = false