Do not set error message to empty string

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-08-23 15:28:44 +05:30
parent c9fbafb909
commit ecfdc314d5
3 changed files with 4 additions and 3 deletions

View File

@ -37,7 +37,6 @@ export class CompleteSSOLoginViewModel extends ViewModel {
_showError(message) { _showError(message) {
this._errorMessage = message; this._errorMessage = message;
this.emitChange("errorMessage"); this.emitChange("errorMessage");
this._errorMessage = "";
} }
async performSSOLoginCompletion() { async performSSOLoginCompletion() {

View File

@ -114,7 +114,6 @@ export class LoginViewModel extends ViewModel {
_showError(message) { _showError(message) {
this._errorMessage = message; this._errorMessage = message;
this.emitChange("errorMessage"); this.emitChange("errorMessage");
this._errorMessage = "";
} }
_toggleBusy(status) { _toggleBusy(status) {
@ -180,6 +179,8 @@ export class LoginViewModel extends ViewModel {
} }
updateHomeServer(newHomeserver) { updateHomeServer(newHomeserver) {
this._errorMessage = "";
this.emitChange("errorMessage");
this._homeserver = newHomeserver; this._homeserver = newHomeserver;
this._disposeViewModels(); this._disposeViewModels();
this._createViewModels(newHomeserver); this._createViewModels(newHomeserver);

View File

@ -38,10 +38,11 @@ export class PasswordLoginViewModel extends ViewModel {
_showError(message) { _showError(message) {
this._errorMessage = message; this._errorMessage = message;
this.emitChange("errorMessage"); this.emitChange("errorMessage");
this._errorMessage = "";
} }
async login(username, password) { async login(username, password) {
this._errorMessage = "";
this.emitChange("errorMessage");
const loginMethod = this._loginOptions.password(username, password); const loginMethod = this._loginOptions.password(username, password);
const status = await this._attemptLogin(loginMethod); const status = await this._attemptLogin(loginMethod);
let error = ""; let error = "";