introducing a reset state for holding onto the reset inputs
This commit is contained in:
parent
a5f404f247
commit
e3d46cfd15
@ -377,7 +377,7 @@ class OnboardingViewModel @AssistedInject constructor(
|
||||
setState {
|
||||
copy(
|
||||
isLoading = false,
|
||||
resetPasswordEmail = null
|
||||
resetState = ResetState()
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -466,7 +466,7 @@ class OnboardingViewModel @AssistedInject constructor(
|
||||
setState {
|
||||
copy(
|
||||
isLoading = false,
|
||||
resetPasswordEmail = action.email
|
||||
resetState = ResetState(email = action.email)
|
||||
)
|
||||
}
|
||||
|
||||
@ -495,7 +495,7 @@ class OnboardingViewModel @AssistedInject constructor(
|
||||
setState {
|
||||
copy(
|
||||
isLoading = false,
|
||||
resetPasswordEmail = null
|
||||
resetState = ResetState()
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ data class OnboardingViewState(
|
||||
@PersistState
|
||||
val signMode: SignMode = SignMode.Unknown,
|
||||
@PersistState
|
||||
val resetPasswordEmail: String? = null,
|
||||
val resetState: ResetState = ResetState(),
|
||||
|
||||
// For SSO session recovery
|
||||
@PersistState
|
||||
@ -84,6 +84,11 @@ data class PersonalizationState(
|
||||
fun supportsPersonalization() = supportsChangingDisplayName || supportsChangingProfilePicture
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
data class ResetState(
|
||||
val email: String? = null
|
||||
) : Parcelable
|
||||
|
||||
@Parcelize
|
||||
data class SelectedAuthenticationState(
|
||||
val description: AuthenticationDescription? = null,
|
||||
|
@ -153,7 +153,7 @@ abstract class AbstractFtueAuthFragment<VB : ViewBinding> : VectorBaseFragment<V
|
||||
|
||||
final override fun invalidate() = withState(viewModel) { state ->
|
||||
// True when email is sent with success to the homeserver
|
||||
isResetPasswordStarted = state.resetPasswordEmail.isNullOrBlank().not()
|
||||
isResetPasswordStarted = state.resetState.email.isNullOrBlank().not()
|
||||
|
||||
updateWithState(state)
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class FtueAuthResetPasswordMailConfirmationFragment @Inject constructor() : Abst
|
||||
}
|
||||
|
||||
private fun setupUi(state: OnboardingViewState) {
|
||||
views.resetPasswordMailConfirmationNotice.text = getString(R.string.login_reset_password_mail_confirmation_notice, state.resetPasswordEmail)
|
||||
views.resetPasswordMailConfirmationNotice.text = getString(R.string.login_reset_password_mail_confirmation_notice, state.resetState.email)
|
||||
}
|
||||
|
||||
private fun submit() {
|
||||
|
Loading…
Reference in New Issue
Block a user