RoomList: try syncing when network is back and inError state
This commit is contained in:
parent
1185dbd276
commit
bb4f61fe12
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue