Update naming to InitialSyncProgressing for clarity.

This commit is contained in:
David Langley 2022-04-12 09:35:35 +01:00
parent 3ae4303ecd
commit 363afd0089
6 changed files with 7 additions and 7 deletions

View File

@ -1 +1 @@
Include original event in live decryption listeners.
Include original event in live decryption listeners and update sync status naming to InitialSyncProgressing for clarity.

View File

@ -28,7 +28,7 @@ interface SyncStatusService {
abstract class InitialSyncStatus : Status()
object Idle : InitialSyncStatus()
data class Progressing(
data class InitialSyncProgressing(
val initSyncStep: InitSyncStep,
val percentProgress: Int = 0
) : InitialSyncStatus()

View File

@ -72,7 +72,7 @@ internal class DefaultSyncStatusService @Inject constructor() :
// Update the progress of the leaf and all its parents
leaf.setProgress(progress)
// Then update the live data using leaf wording and root progress
status.postValue(SyncStatusService.Status.Progressing(leaf.initSyncStep, root.currentProgress.toInt()))
status.postValue(SyncStatusService.Status.InitialSyncProgressing(leaf.initSyncStep, root.currentProgress.toInt()))
}
}
}

View File

@ -264,7 +264,7 @@ class AutoRageShaker @Inject constructor(
session.getSyncStatusLive()
.asFlow()
.onEach {
hasSynced = it !is SyncStatusService.Status.Progressing
hasSynced = it !is SyncStatusService.Status.InitialSyncProgressing
}
.launchIn(session.coroutineScope)
activeSessionIds.add(sessionId)

View File

@ -307,7 +307,7 @@ class HomeActivity :
private fun renderState(state: HomeActivityViewState) {
when (val status = state.syncStatusServiceStatus) {
is SyncStatusService.Status.Progressing -> {
is SyncStatusService.Status.InitialSyncProgressing -> {
val initSyncStepStr = initSyncStepFormatter.format(status.initSyncStep)
Timber.v("$initSyncStepStr ${status.percentProgress}")
views.waitingView.root.setOnClickListener {

View File

@ -137,11 +137,11 @@ class HomeActivityViewModel @AssistedInject constructor(
.asFlow()
.onEach { status ->
when (status) {
is SyncStatusService.Status.Progressing -> {
is SyncStatusService.Status.InitialSyncProgressing -> {
// Schedule a check of the bootstrap when the init sync will be finished
checkBootstrap = true
}
is SyncStatusService.Status.Idle -> {
is SyncStatusService.Status.Idle -> {
if (checkBootstrap) {
checkBootstrap = false
maybeBootstrapCrossSigningAfterInitialSync()