RoomList: try syncing when network is back and inError state

This commit is contained in:
ganfra
2023-06-23 17:07:27 +02:00
parent 7846fa19b4
commit f3e072bdb0
6 changed files with 45 additions and 17 deletions
@@ -23,21 +23,19 @@ import kotlinx.coroutines.flow.StateFlow
class FakeSyncService : SyncService {
private val syncState = MutableStateFlow(SyncState.Idle)
private val syncStateFlow = MutableStateFlow(SyncState.Idle)
fun simulateError() {
syncState.value = SyncState.InError
syncStateFlow.value = SyncState.InError
}
override fun startSync() {
syncState.value = SyncState.Syncing
syncStateFlow.value = SyncState.Syncing
}
override fun stopSync() {
syncState.value = SyncState.Terminated
syncStateFlow.value = SyncState.Terminated
}
override fun syncState(): StateFlow<SyncState> {
return syncState
}
override val syncState: StateFlow<SyncState> = syncStateFlow
}