mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Cleanup sync service state management using new currentState sdk support
This commit is contained in:
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
|
||||
|
||||
Reference in New Issue
Block a user