From ecfdc314d5a8b9b0c4bee1c1538176c32414ad3b Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 23 Aug 2021 15:28:44 +0530 Subject: [PATCH] Do not set error message to empty string Signed-off-by: RMidhunSuresh --- src/domain/login/CompleteSSOLoginViewModel.js | 1 - src/domain/login/LoginViewModel.js | 3 ++- src/domain/login/PasswordLoginViewModel.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/domain/login/CompleteSSOLoginViewModel.js b/src/domain/login/CompleteSSOLoginViewModel.js index ded09cd9..c06b3ffd 100644 --- a/src/domain/login/CompleteSSOLoginViewModel.js +++ b/src/domain/login/CompleteSSOLoginViewModel.js @@ -37,7 +37,6 @@ export class CompleteSSOLoginViewModel extends ViewModel { _showError(message) { this._errorMessage = message; this.emitChange("errorMessage"); - this._errorMessage = ""; } async performSSOLoginCompletion() { diff --git a/src/domain/login/LoginViewModel.js b/src/domain/login/LoginViewModel.js index 27e45d1f..13087581 100644 --- a/src/domain/login/LoginViewModel.js +++ b/src/domain/login/LoginViewModel.js @@ -114,7 +114,6 @@ export class LoginViewModel extends ViewModel { _showError(message) { this._errorMessage = message; this.emitChange("errorMessage"); - this._errorMessage = ""; } _toggleBusy(status) { @@ -180,6 +179,8 @@ export class LoginViewModel extends ViewModel { } updateHomeServer(newHomeserver) { + this._errorMessage = ""; + this.emitChange("errorMessage"); this._homeserver = newHomeserver; this._disposeViewModels(); this._createViewModels(newHomeserver); diff --git a/src/domain/login/PasswordLoginViewModel.js b/src/domain/login/PasswordLoginViewModel.js index 8cdef3c5..0d534b90 100644 --- a/src/domain/login/PasswordLoginViewModel.js +++ b/src/domain/login/PasswordLoginViewModel.js @@ -38,10 +38,11 @@ export class PasswordLoginViewModel extends ViewModel { _showError(message) { this._errorMessage = message; this.emitChange("errorMessage"); - this._errorMessage = ""; } async login(username, password) { + this._errorMessage = ""; + this.emitChange("errorMessage"); const loginMethod = this._loginOptions.password(username, password); const status = await this._attemptLogin(loginMethod); let error = "";