Sync: add more safety to avoid some race conditions
This commit is contained in:
parent
785c4a52f1
commit
65210b72f5
1 changed files with 1 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue