Sync: add more safety to avoid some race conditions
This commit is contained in:
parent
870b5d3fe1
commit
0216a42531
1 changed files with 1 additions and 3 deletions
|
|
@ -58,9 +58,7 @@ class RustSyncService(
|
||||||
.map(RoomListServiceState::toSyncState)
|
.map(RoomListServiceState::toSyncState)
|
||||||
.onEach { state ->
|
.onEach { state ->
|
||||||
Timber.v("Sync state=$state")
|
Timber.v("Sync state=$state")
|
||||||
if (state == SyncState.InError || state == SyncState.Terminated) {
|
isSyncing.set(state == SyncState.Syncing)
|
||||||
isSyncing.set(false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.stateIn(sessionCoroutineScope, SharingStarted.Eagerly, SyncState.Idle)
|
.stateIn(sessionCoroutineScope, SharingStarted.Eagerly, SyncState.Idle)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue