From abf62aff475e6003fc3796cd74338a43b23f33e5 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 17 Mar 2022 17:51:01 +0000 Subject: [PATCH] extracting named function out for cancelling the email validation job, giving more context to the currentjob=null --- .../vector/app/features/onboarding/OnboardingViewModel.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt index 3f2b5adcbe..6659058b4e 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt @@ -165,7 +165,7 @@ class OnboardingViewModel @AssistedInject constructor( is OnboardingAction.ProfilePictureSelected -> handleProfilePictureSelected(action) OnboardingAction.SaveSelectedProfilePicture -> updateProfilePicture() is OnboardingAction.PostViewEvent -> _viewEvents.post(action.viewEvent) - OnboardingAction.StopEmailValidationCheck -> currentJob = null + OnboardingAction.StopEmailValidationCheck -> cancelWaitForEmailValidation() }.exhaustive } @@ -915,6 +915,10 @@ class OnboardingViewModel @AssistedInject constructor( private fun completePersonalization() { _viewEvents.post(OnboardingViewEvents.OnPersonalizationComplete) } + + private fun cancelWaitForEmailValidation() { + currentJob = null + } } private fun LoginMode.supportsSignModeScreen(): Boolean {