Login screens: reset password: fix a few errors

This commit is contained in:
Benoit Marty 2019-11-21 23:15:49 +01:00
parent ef35f0a044
commit 51f53e2ae9
3 changed files with 12 additions and 4 deletions

View File

@ -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),

View File

@ -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

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -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" />
<TextView
android:layout_width="wrap_content"