Sync: add more safety to avoid some race conditions
This commit is contained in:
@@ -58,9 +58,7 @@ class RustSyncService(
|
||||
.map(RoomListServiceState::toSyncState)
|
||||
.onEach { state ->
|
||||
Timber.v("Sync state=$state")
|
||||
if (state == SyncState.InError || state == SyncState.Terminated) {
|
||||
isSyncing.set(false)
|
||||
}
|
||||
isSyncing.set(state == SyncState.Syncing)
|
||||
}
|
||||
.distinctUntilChanged()
|
||||
.stateIn(sessionCoroutineScope, SharingStarted.Eagerly, SyncState.Idle)
|
||||
|
||||
Reference in New Issue
Block a user