Skip to content

Commit

Permalink
Update naming to InitialSyncProgressing for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
langleyd committed Apr 12, 2022
1 parent 3ae4303 commit 363afd0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion changelog.d/5639.sdk
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion vector/src/main/java/im/vector/app/AutoRageShaker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 363afd0

Please sign in to comment.