inlining single use extension

This commit is contained in:
Adam Brown 2022-05-16 17:26:12 +01:00
parent 51ffe26a91
commit 444980395e
1 changed files with 3 additions and 3 deletions

View File

@ -292,7 +292,9 @@ class OnboardingViewModel @AssistedInject constructor(
private fun emitFlowResultViewEvent(flowResult: FlowResult) { private fun emitFlowResultViewEvent(flowResult: FlowResult) {
withState { state -> withState { state ->
val orderedResult = when { val orderedResult = when {
state.hasSelectedMatrixOrg() && vectorFeatures.isOnboardingCombinedRegisterEnabled() -> flowResult.overrideOrder() state.hasSelectedMatrixOrg() && vectorFeatures.isOnboardingCombinedRegisterEnabled() -> flowResult.copy(
missingStages = flowResult.missingStages.sortedWith(MatrixOrgMissingRegistrationStagesComparator())
)
else -> flowResult else -> flowResult
} }
_viewEvents.post(OnboardingViewEvents.RegistrationFlowResult(orderedResult, isRegistrationStarted)) _viewEvents.post(OnboardingViewEvents.RegistrationFlowResult(orderedResult, isRegistrationStarted))
@ -301,8 +303,6 @@ class OnboardingViewModel @AssistedInject constructor(
private fun OnboardingViewState.hasSelectedMatrixOrg() = selectedHomeserver.userFacingUrl == matrixOrgUrl private fun OnboardingViewState.hasSelectedMatrixOrg() = selectedHomeserver.userFacingUrl == matrixOrgUrl
private fun FlowResult.overrideOrder() = copy(missingStages = missingStages.sortedWith(MatrixOrgMissingRegistrationStagesComparator()))
private fun handleRegisterWith(action: OnboardingAction.Register) { private fun handleRegisterWith(action: OnboardingAction.Register) {
reAuthHelper.data = action.password reAuthHelper.data = action.password
handleRegisterAction( handleRegisterAction(