From 6b6420a2297c78cfc2626c8e23bf8d66d40c3a37 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 18 Nov 2024 15:18:20 +0200 Subject: [PATCH] Expose the public search feature flag in the developer settings and disable it by default. --- ElementX/Sources/Application/AppSettings.swift | 2 +- .../DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift | 1 + .../DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ElementX/Sources/Application/AppSettings.swift b/ElementX/Sources/Application/AppSettings.swift index 40b0d76bfe..5949761ec5 100644 --- a/ElementX/Sources/Application/AppSettings.swift +++ b/ElementX/Sources/Application/AppSettings.swift @@ -268,7 +268,7 @@ final class AppSettings { // MARK: - Feature Flags - @UserPreference(key: UserDefaultsKeys.publicSearchEnabled, defaultValue: isDevelopmentBuild, storageType: .volatile) + @UserPreference(key: UserDefaultsKeys.publicSearchEnabled, defaultValue: false, storageType: .userDefaults(store)) var publicSearchEnabled @UserPreference(key: UserDefaultsKeys.fuzzyRoomListSearchEnabled, defaultValue: false, storageType: .userDefaults(store)) diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift index f8523ff3c1..1024600448 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift @@ -43,6 +43,7 @@ enum DeveloperOptionsScreenViewAction { protocol DeveloperOptionsProtocol: AnyObject { var logLevel: TracingConfiguration.LogLevel { get set } var slidingSyncDiscovery: AppSettings.SlidingSyncDiscovery { get set } + var publicSearchEnabled: Bool { get set } var hideUnreadMessagesBadge: Bool { get set } var fuzzyRoomListSearchEnabled: Bool { get set } var hideTimelineMedia: Bool { get set } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index d9e6f2a6cd..08b06c6e82 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -36,6 +36,10 @@ struct DeveloperOptionsScreen: View { } Section("Room List") { + Toggle(isOn: $context.publicSearchEnabled) { + Text("Public search") + } + Toggle(isOn: $context.hideUnreadMessagesBadge) { Text("Hide grey dots") }