mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Sync: add more safety to avoid some race conditions
This commit is contained in:
+1
-3
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user