Skip to content

Commit

Permalink
extracting the personalization complete emitting to a dedicated function
Browse files Browse the repository at this point in the history
  • Loading branch information
ouchadam committed Mar 10, 2022
1 parent 7e4941b commit 305c52b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -954,7 +954,7 @@ class OnboardingViewModel @AssistedInject constructor(
withPersonalisationState {
when {
it.supportsChangingProfilePicture -> _viewEvents.post(OnboardingViewEvents.OnChooseProfilePicture)
else -> _viewEvents.post(OnboardingViewEvents.OnPersonalizationComplete)
else -> completePersonalization()
}
}
}
Expand Down Expand Up @@ -1000,6 +1000,10 @@ class OnboardingViewModel @AssistedInject constructor(
}

private fun onProfilePictureSaved() {
completePersonalization()
}

private fun completePersonalization() {
_viewEvents.post(OnboardingViewEvents.OnPersonalizationComplete)
}
}
Expand Down

0 comments on commit 305c52b

Please sign in to comment.