extracting the personalization complete emitting to a dedicated function

This commit is contained in:
Adam Brown 2022-03-10 17:24:15 +00:00
parent d89cc71eb4
commit c2fe669670
1 changed files with 6 additions and 2 deletions

View File

@ -159,7 +159,7 @@ class OnboardingViewModel @AssistedInject constructor(
OnboardingAction.ClearHomeServerHistory -> handleClearHomeServerHistory()
is OnboardingAction.UpdateDisplayName -> updateDisplayName(action.displayName)
OnboardingAction.UpdateDisplayNameSkipped -> handleDisplayNameStepComplete()
OnboardingAction.UpdateProfilePictureSkipped -> _viewEvents.post(OnboardingViewEvents.OnPersonalizationComplete)
OnboardingAction.UpdateProfilePictureSkipped -> completePersonalization()
OnboardingAction.PersonalizeProfile -> handlePersonalizeProfile()
is OnboardingAction.ProfilePictureSelected -> handleProfilePictureSelected(action)
OnboardingAction.SaveSelectedProfilePicture -> updateProfilePicture()
@ -954,7 +954,7 @@ class OnboardingViewModel @AssistedInject constructor(
withPersonalisationState {
when {
it.supportsChangingProfilePicture -> _viewEvents.post(OnboardingViewEvents.OnChooseProfilePicture)
else -> _viewEvents.post(OnboardingViewEvents.OnPersonalizationComplete)
else -> completePersonalization()
}
}
}
@ -1000,6 +1000,10 @@ class OnboardingViewModel @AssistedInject constructor(
}
private fun onProfilePictureSaved() {
completePersonalization()
}
private fun completePersonalization() {
_viewEvents.post(OnboardingViewEvents.OnPersonalizationComplete)
}
}