From 51f53e2ae92db586ac5aad6bf5705a380dada0f1 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 21 Nov 2019 23:15:49 +0100 Subject: [PATCH] Login screens: reset password: fix a few errors --- .../java/im/vector/riotx/features/login/LoginActivity.kt | 5 ++++- .../java/im/vector/riotx/features/login/LoginViewModel.kt | 6 ++++++ .../res/layout/fragment_login_reset_password_success.xml | 5 ++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt index 3e8d8b639b..4ab7dc266b 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt @@ -95,7 +95,10 @@ class LoginActivity : VectorBaseActivity(), ToolbarConfigurable { supportFragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) addFragmentToBackstack(R.id.loginFragmentContainer, LoginResetPasswordSuccessFragment::class.java) } - is LoginNavigation.OnResetPasswordMailConfirmationSuccessDone -> supportFragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) + is LoginNavigation.OnResetPasswordMailConfirmationSuccessDone -> { + // FIXME It goes to far (to the top fragment) + supportFragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) + } is LoginNavigation.OnSendEmailSuccess -> addFragmentToBackstack(R.id.loginFragmentContainer, LoginWaitForEmailFragment::class.java, LoginWaitForEmailFragmentArgument(it.email), diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginViewModel.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginViewModel.kt index 9b38a0f61b..36792008aa 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginViewModel.kt @@ -122,11 +122,13 @@ class LoginViewModel @AssistedInject constructor(@Assisted initialState: LoginVi private fun handleCheckIfEmailHasBeenValidated(action: LoginAction.CheckIfEmailHasBeenValidated) { // We do not want the common progress bar to be displayed, so we do not change asyncRegistration value in the state currentTask?.cancel() + currentTask = null currentTask = registrationWizard?.checkIfEmailHasBeenValidated(action.delayMillis, registrationCallback) } private fun handleStopEmailValidationCheck() { currentTask?.cancel() + currentTask = null } private fun handleValidateThreePid(action: LoginAction.ValidateThreePid) { @@ -260,6 +262,10 @@ class LoginViewModel @AssistedInject constructor(@Assisted initialState: LoginVi } } LoginAction.ResetHomeServerUrl -> { + homeServerConnectionConfig = null + registrationWizard = null + loginWizard = null + setState { copy( asyncHomeServerLoginFlowRequest = Uninitialized diff --git a/vector/src/main/res/layout/fragment_login_reset_password_success.xml b/vector/src/main/res/layout/fragment_login_reset_password_success.xml index 4f5a0292f5..12ab3c04a4 100644 --- a/vector/src/main/res/layout/fragment_login_reset_password_success.xml +++ b/vector/src/main/res/layout/fragment_login_reset_password_success.xml @@ -1,6 +1,5 @@ @@ -21,8 +20,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/layout_vertical_margin" - android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small" - tools:text="@string/login_reset_password_success_notice" /> + android:text="@string/login_reset_password_success_notice" + android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small" />