Merge pull request #2397 from vector-im/feature/bma/registration_email

Registration: annoying error message scares every new user when they add an email (#2391)
This commit is contained in:
Benoit Marty 2020-11-16 13:36:45 +01:00 committed by GitHub
commit ae5331cf40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -12,6 +12,7 @@ Bugfix 🐛:
- Fix issue when restoring draft after sharing (#2287) - Fix issue when restoring draft after sharing (#2287)
- Fix issue when updating the avatar of a room (new avatar vanishing) - Fix issue when updating the avatar of a room (new avatar vanishing)
- Discard change dialog displayed by mistake when avatar has been updated - Discard change dialog displayed by mistake when avatar has been updated
- Registration: annoying error message scares every new user when they add an email (#2391)
Translations 🗣: Translations 🗣:
- -

View file

@ -69,6 +69,11 @@ abstract class AbstractLoginFragment : VectorBaseFragment(), OnBackPressed {
} }
override fun showFailure(throwable: Throwable) { override fun showFailure(throwable: Throwable) {
// Only the resumed Fragment can eventually show the error, to avoid multiple dialog display
if (!isResumed) {
return
}
when (throwable) { when (throwable) {
is Failure.Cancelled -> is Failure.Cancelled ->
/* Ignore this error, user has cancelled the action */ /* Ignore this error, user has cancelled the action */

View file

@ -207,7 +207,6 @@ class LoginViewModel @AssistedInject constructor(
private fun handleCheckIfEmailHasBeenValidated(action: LoginAction.CheckIfEmailHasBeenValidated) { 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 // We do not want the common progress bar to be displayed, so we do not change asyncRegistration value in the state
currentTask?.cancel() currentTask?.cancel()
currentTask = null
currentTask = registrationWizard?.checkIfEmailHasBeenValidated(action.delayMillis, registrationCallback) currentTask = registrationWizard?.checkIfEmailHasBeenValidated(action.delayMillis, registrationCallback)
} }