renaming comparator to only specify the matrix.org domain

This commit is contained in:
Adam Brown 2022-05-17 10:31:32 +01:00
parent 444980395e
commit 1ec99ee89e
3 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,7 @@ import im.vector.app.features.login.ReAuthHelper
import im.vector.app.features.login.ServerType
import im.vector.app.features.login.SignMode
import im.vector.app.features.onboarding.StartAuthenticationFlowUseCase.StartAuthenticationResult
import im.vector.app.features.onboarding.ftueauth.MatrixOrgMissingRegistrationStagesComparator
import im.vector.app.features.onboarding.ftueauth.MatrixOrgRegistrationStagesComparator
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.launch
@ -293,7 +293,7 @@ class OnboardingViewModel @AssistedInject constructor(
withState { state ->
val orderedResult = when {
state.hasSelectedMatrixOrg() && vectorFeatures.isOnboardingCombinedRegisterEnabled() -> flowResult.copy(
missingStages = flowResult.missingStages.sortedWith(MatrixOrgMissingRegistrationStagesComparator())
missingStages = flowResult.missingStages.sortedWith(MatrixOrgRegistrationStagesComparator())
)
else -> flowResult
}

View File

@ -18,7 +18,7 @@ package im.vector.app.features.onboarding.ftueauth
import org.matrix.android.sdk.api.auth.registration.Stage
class MatrixOrgMissingRegistrationStagesComparator : Comparator<Stage> {
class MatrixOrgRegistrationStagesComparator : Comparator<Stage> {
override fun compare(a: Stage?, b: Stage?): Int {
return (a?.toPriority() ?: 0).compareTo(b?.toPriority() ?: 0)

View File

@ -25,7 +25,7 @@ import im.vector.app.test.fixtures.anOtherStage
import org.amshove.kluent.shouldBeEqualTo
import org.junit.Test
class MatrixOrgMissingRegistrationStagesComparatorTest {
class MatrixOrgRegistrationStagesComparatorTest {
@Test
fun `when ordering stages, then prioritizes email`() {
@ -38,7 +38,7 @@ class MatrixOrgMissingRegistrationStagesComparatorTest {
aTermsStage()
)
val result = input.sortedWith(MatrixOrgMissingRegistrationStagesComparator())
val result = input.sortedWith(MatrixOrgRegistrationStagesComparator())
result shouldBeEqualTo listOf(
anEmailStage(),