Merge pull request #920 from vector-im/feature/bma/slidingSyncState

Sliding sync state rendering
This commit is contained in:
Benoit Marty 2023-07-19 16:26:14 +02:00 committed by GitHub
commit 8b97d50050
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 200 additions and 32 deletions

View file

@ -144,7 +144,7 @@ class RustMatrixClient constructor(
client.setDelegate(clientDelegate)
rustSyncService.syncState
.onEach { syncState ->
if (syncState == SyncState.Syncing) {
if (syncState == SyncState.Running) {
onSlidingSyncUpdate()
}
}.launchIn(sessionCoroutineScope)

View file

@ -24,8 +24,8 @@ internal fun RoomListServiceState.toSyncState(): SyncState {
return when (this) {
RoomListServiceState.INIT,
RoomListServiceState.SETTING_UP -> SyncState.Idle
RoomListServiceState.RUNNING -> SyncState.Syncing
RoomListServiceState.ERROR -> SyncState.InError
RoomListServiceState.RUNNING -> SyncState.Running
RoomListServiceState.ERROR -> SyncState.Error
RoomListServiceState.TERMINATED -> SyncState.Terminated
}
}
@ -33,8 +33,8 @@ internal fun RoomListServiceState.toSyncState(): SyncState {
internal fun SyncServiceState.toSyncState(): SyncState {
return when (this) {
SyncServiceState.IDLE -> SyncState.Idle
SyncServiceState.RUNNING -> SyncState.Syncing
SyncServiceState.RUNNING -> SyncState.Running
SyncServiceState.TERMINATED -> SyncState.Terminated
SyncServiceState.ERROR -> SyncState.InError
SyncServiceState.ERROR -> SyncState.Error
}
}