Cleanup sync service state management using new currentState sdk support

This commit is contained in:
Stefan Ceriu
2023-07-18 11:52:54 +03:00
committed by Stefan Ceriu
parent c83a2bd729
commit 3a538c6e29
@@ -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<SyncServiceState, Never>(.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