inlining single use extension
This commit is contained in:
parent
51ffe26a91
commit
444980395e
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue