extracting named function out for cancelling the email validation job, giving more context to the currentjob=null

This commit is contained in:
Adam Brown 2022-03-17 17:51:01 +00:00
parent 192d1c4f2d
commit abf62aff47

View file

@ -165,7 +165,7 @@ class OnboardingViewModel @AssistedInject constructor(
is OnboardingAction.ProfilePictureSelected -> handleProfilePictureSelected(action) is OnboardingAction.ProfilePictureSelected -> handleProfilePictureSelected(action)
OnboardingAction.SaveSelectedProfilePicture -> updateProfilePicture() OnboardingAction.SaveSelectedProfilePicture -> updateProfilePicture()
is OnboardingAction.PostViewEvent -> _viewEvents.post(action.viewEvent) is OnboardingAction.PostViewEvent -> _viewEvents.post(action.viewEvent)
OnboardingAction.StopEmailValidationCheck -> currentJob = null OnboardingAction.StopEmailValidationCheck -> cancelWaitForEmailValidation()
}.exhaustive }.exhaustive
} }
@ -915,6 +915,10 @@ class OnboardingViewModel @AssistedInject constructor(
private fun completePersonalization() { private fun completePersonalization() {
_viewEvents.post(OnboardingViewEvents.OnPersonalizationComplete) _viewEvents.post(OnboardingViewEvents.OnPersonalizationComplete)
} }
private fun cancelWaitForEmailValidation() {
currentJob = null
}
} }
private fun LoginMode.supportsSignModeScreen(): Boolean { private fun LoginMode.supportsSignModeScreen(): Boolean {