Update the SDK.

Handles changes that removed support for the sliding sync proxy.
This commit is contained in:
Doug
2025-02-18 10:34:32 +00:00
committed by Doug
parent f77faee981
commit 8c07ee35c4
33 changed files with 229 additions and 309 deletions
@@ -22,10 +22,9 @@ final class DeveloperOptionsScreenCoordinator: CoordinatorProtocol {
actionsSubject.eraseToAnyPublisher()
}
init(isUsingNativeSlidingSync: Bool) {
init() {
viewModel = DeveloperOptionsScreenViewModel(developerOptions: ServiceLocator.shared.settings,
elementCallBaseURL: ServiceLocator.shared.settings.elementCallBaseURL,
isUsingNativeSlidingSync: isUsingNativeSlidingSync)
elementCallBaseURL: ServiceLocator.shared.settings.elementCallBaseURL)
viewModel.actions
.sink { [weak self] action in
@@ -13,12 +13,7 @@ enum DeveloperOptionsScreenViewModelAction {
struct DeveloperOptionsScreenViewState: BindableState {
let elementCallBaseURL: URL
let isUsingNativeSlidingSync: Bool
var bindings: DeveloperOptionsScreenViewStateBindings
var slidingSyncFooter: String {
"The method used to configure sliding sync when signing in. Changing this setting has no effect until you sign out.\n\nYour current session is using \(isUsingNativeSlidingSync ? "native sliding sync." : "a sliding sync proxy.")"
}
}
// periphery: ignore - subscripts are seen as false positive
@@ -42,7 +37,6 @@ enum DeveloperOptionsScreenViewAction {
protocol DeveloperOptionsProtocol: AnyObject {
var logLevel: LogLevel { get set }
var slidingSyncDiscovery: AppSettings.SlidingSyncDiscovery { get set }
var publicSearchEnabled: Bool { get set }
var hideUnreadMessagesBadge: Bool { get set }
var fuzzyRoomListSearchEnabled: Bool { get set }
@@ -17,9 +17,9 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
actionsSubject.eraseToAnyPublisher()
}
init(developerOptions: DeveloperOptionsProtocol, elementCallBaseURL: URL, isUsingNativeSlidingSync: Bool) {
init(developerOptions: DeveloperOptionsProtocol, elementCallBaseURL: URL) {
let bindings = DeveloperOptionsScreenViewStateBindings(developerOptions: developerOptions)
let state = DeveloperOptionsScreenViewState(elementCallBaseURL: elementCallBaseURL, isUsingNativeSlidingSync: isUsingNativeSlidingSync, bindings: bindings)
let state = DeveloperOptionsScreenViewState(elementCallBaseURL: elementCallBaseURL, bindings: bindings)
super.init(initialViewState: state)
}
@@ -32,18 +32,6 @@ struct DeveloperOptionsScreen: View {
}
}
Section {
Picker("Discovery", selection: $context.slidingSyncDiscovery) {
Text("Proxy only").tag(AppSettings.SlidingSyncDiscovery.proxy)
Text("Automatic").tag(AppSettings.SlidingSyncDiscovery.native)
Text("Force Native ⚠️").tag(AppSettings.SlidingSyncDiscovery.forceNative)
}
} header: {
Text("Sliding Sync")
} footer: {
Text(context.viewState.slidingSyncFooter)
}
Section("Room List") {
Toggle(isOn: $context.publicSearchEnabled) {
Text("Public search")
@@ -175,8 +163,7 @@ private struct LogLevelConfigurationView: View {
struct DeveloperOptionsScreen_Previews: PreviewProvider {
static let viewModel = DeveloperOptionsScreenViewModel(developerOptions: ServiceLocator.shared.settings,
elementCallBaseURL: ServiceLocator.shared.settings.elementCallBaseURL,
isUsingNativeSlidingSync: true)
elementCallBaseURL: ServiceLocator.shared.settings.elementCallBaseURL)
static var previews: some View {
NavigationStack {
DeveloperOptionsScreen(context: viewModel.context)