renaming reset action to also capture registering along with login

This commit is contained in:
Adam Brown 2022-03-28 11:59:54 +01:00
parent c3ab895a54
commit e8791fb3cf
9 changed files with 11 additions and 11 deletions

View file

@ -52,7 +52,7 @@ sealed interface OnboardingAction : VectorViewModelAction {
object ResetHomeServerType : ResetAction object ResetHomeServerType : ResetAction
object ResetHomeServerUrl : ResetAction object ResetHomeServerUrl : ResetAction
object ResetSignMode : ResetAction object ResetSignMode : ResetAction
object ResetLogin : ResetAction object ResetAuthenticationAttempt : ResetAction
object ResetResetPassword : ResetAction object ResetResetPassword : ResetAction
// Homeserver history // Homeserver history

View file

@ -313,7 +313,7 @@ class OnboardingViewModel @AssistedInject constructor(
} }
} }
} }
OnboardingAction.ResetSignMode -> { OnboardingAction.ResetSignMode -> {
setState { setState {
copy( copy(
isLoading = false, isLoading = false,
@ -323,13 +323,13 @@ class OnboardingViewModel @AssistedInject constructor(
) )
} }
} }
OnboardingAction.ResetLogin -> { OnboardingAction.ResetAuthenticationAttempt -> {
viewModelScope.launch { viewModelScope.launch {
authenticationService.cancelPendingLoginOrRegistration() authenticationService.cancelPendingLoginOrRegistration()
setState { copy(isLoading = false) } setState { copy(isLoading = false) }
} }
} }
OnboardingAction.ResetResetPassword -> { OnboardingAction.ResetResetPassword -> {
setState { setState {
copy( copy(
isLoading = false, isLoading = false,

View file

@ -191,7 +191,7 @@ class FtueAuthCaptchaFragment @Inject constructor(
} }
override fun resetViewModel() { override fun resetViewModel() {
viewModel.handle(OnboardingAction.ResetLogin) viewModel.handle(OnboardingAction.ResetAuthenticationAttempt)
} }
override fun updateWithState(state: OnboardingViewState) { override fun updateWithState(state: OnboardingViewState) {

View file

@ -160,7 +160,7 @@ class FtueAuthCombinedSignUpFragment @Inject constructor() : AbstractSSOFtueAuth
) )
override fun resetViewModel() { override fun resetViewModel() {
viewModel.handle(OnboardingAction.ResetLogin) viewModel.handle(OnboardingAction.ResetAuthenticationAttempt)
} }
override fun onError(throwable: Throwable) { override fun onError(throwable: Throwable) {

View file

@ -254,6 +254,6 @@ class FtueAuthGenericTextInputFormFragment @Inject constructor() : AbstractFtueA
} }
override fun resetViewModel() { override fun resetViewModel() {
viewModel.handle(OnboardingAction.ResetLogin) viewModel.handle(OnboardingAction.ResetAuthenticationAttempt)
} }
} }

View file

@ -254,7 +254,7 @@ class FtueAuthLoginFragment @Inject constructor() : AbstractSSOFtueAuthFragment<
} }
override fun resetViewModel() { override fun resetViewModel() {
viewModel.handle(OnboardingAction.ResetLogin) viewModel.handle(OnboardingAction.ResetAuthenticationAttempt)
} }
override fun onError(throwable: Throwable) { override fun onError(throwable: Throwable) {

View file

@ -78,6 +78,6 @@ class FtueAuthWaitForEmailFragment @Inject constructor() : AbstractFtueAuthFragm
} }
override fun resetViewModel() { override fun resetViewModel() {
viewModel.handle(OnboardingAction.ResetLogin) viewModel.handle(OnboardingAction.ResetAuthenticationAttempt)
} }
} }

View file

@ -235,7 +235,7 @@ class FtueAuthWebFragment @Inject constructor(
} }
override fun resetViewModel() { override fun resetViewModel() {
viewModel.handle(OnboardingAction.ResetLogin) viewModel.handle(OnboardingAction.ResetAuthenticationAttempt)
} }
override fun onBackPressed(toolbarButton: Boolean): Boolean { override fun onBackPressed(toolbarButton: Boolean): Boolean {

View file

@ -121,6 +121,6 @@ class FtueAuthTermsFragment @Inject constructor(
} }
override fun resetViewModel() { override fun resetViewModel() {
viewModel.handle(OnboardingAction.ResetLogin) viewModel.handle(OnboardingAction.ResetAuthenticationAttempt)
} }
} }