avoid problems

This commit is contained in:
Mauro Romito
2023-07-21 11:01:12 +02:00
committed by Mauro
parent fbe05a8679
commit c0b868e3c7
5 changed files with 12 additions and 25 deletions
@@ -30,7 +30,6 @@ struct DeveloperOptionsScreenViewStateBindings {
var readReceiptsEnabled: Bool
var isEncryptionSyncEnabled: Bool
var notificationSettingsEnabled: Bool
var timelineDiffableAnimationsEnabled: Bool
}
enum DeveloperOptionsScreenViewAction {
@@ -39,6 +38,5 @@ enum DeveloperOptionsScreenViewAction {
case changedReadReceiptsEnabled
case changedIsEncryptionSyncEnabled
case changedNotificationSettingsEnabled
case changedTimelineDiffableAnimationsEnabled
case clearCache
}
@@ -30,8 +30,7 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
userSuggestionsEnabled: appSettings.userSuggestionsEnabled,
readReceiptsEnabled: appSettings.readReceiptsEnabled,
isEncryptionSyncEnabled: appSettings.isEncryptionSyncEnabled,
notificationSettingsEnabled: appSettings.notificationSettingsEnabled,
timelineDiffableAnimationsEnabled: appSettings.timelineDiffableAnimationsEnabled)
notificationSettingsEnabled: appSettings.notificationSettingsEnabled)
let state = DeveloperOptionsScreenViewState(bindings: bindings)
super.init(initialViewState: state)
@@ -53,8 +52,6 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
appSettings.isEncryptionSyncEnabled = state.bindings.isEncryptionSyncEnabled
case .changedNotificationSettingsEnabled:
appSettings.notificationSettingsEnabled = state.bindings.notificationSettingsEnabled
case .changedTimelineDiffableAnimationsEnabled:
appSettings.timelineDiffableAnimationsEnabled = state.bindings.timelineDiffableAnimationsEnabled
case .clearCache:
callback?(.clearCache)
}
@@ -63,13 +63,6 @@ struct DeveloperOptionsScreen: View {
.onChange(of: context.userSuggestionsEnabled) { _ in
context.send(viewAction: .changedUserSuggestionsEnabled)
}
Toggle(isOn: $context.timelineDiffableAnimationsEnabled) {
Text("Enable diffable animations in the timeline")
}
.onChange(of: context.timelineDiffableAnimationsEnabled) { _ in
context.send(viewAction: .changedTimelineDiffableAnimationsEnabled)
}
}
Section {