From 3a538c6e2921be59b7e45c676fd4d251afa41421 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 18 Jul 2023 11:52:54 +0300 Subject: [PATCH] Cleanup sync service state management using new `currentState` sdk support --- ElementX/Sources/Services/Client/ClientProxy.swift | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index fa5d2cc52..2b04fa4d3 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -34,9 +34,6 @@ class ClientProxy: ClientProxyProtocol { private var syncService: SyncService? private var syncServiceStateUpdateTaskHandle: TaskHandle? - #warning("This is a workaround until the RustSDK provides a sync service state getter") - private var appServiceStateUpdateCurrentValueSubject = CurrentValueSubject(.terminated) - var roomSummaryProvider: RoomSummaryProviderProtocol? var inviteSummaryProvider: RoomSummaryProviderProtocol? @@ -113,7 +110,7 @@ class ClientProxy: ClientProxyProtocol { } var isSyncing: Bool { - isStartingSync || appServiceStateUpdateCurrentValueSubject.value == .running + isStartingSync || syncService?.currentState() == .running } /// Ensure we don't call start sync whilst awaiting a previous call. @@ -440,8 +437,6 @@ class ClientProxy: ClientProxyProtocol { MXLog.info("Received app service update: \(state)") - appServiceStateUpdateCurrentValueSubject.send(state) - switch state { case .running, .terminated, .idle: break