Inline method

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-08-19 20:30:14 +05:30
parent 738603e890
commit 068fba3616

View file

@ -49,7 +49,12 @@ export class LoginViewModel extends ViewModel {
} }
else { else {
this._errorMessage = ""; this._errorMessage = "";
await this.queryLogin(homeserver); try {
this._loginOptions = await this._sessionContainer.queryLogin(homeserver);
}
catch (e) {
this._loginOptions = null;
}
if (this._loginOptions) { if (this._loginOptions) {
if (this._loginOptions.sso) { this._showSSOLogin(); } if (this._loginOptions.sso) { this._showSSOLogin(); }
if (this._loginOptions.password) { this._showPasswordLogin(); } if (this._loginOptions.password) { this._showPasswordLogin(); }
@ -78,15 +83,6 @@ export class LoginViewModel extends ViewModel {
this.emitChange("errorMessage"); this.emitChange("errorMessage");
} }
async queryLogin(homeserver) {
try {
this._loginOptions = await this._sessionContainer.queryLogin(homeserver);
}
catch (e) {
this._loginOptions = null;
}
}
_disposeViewModels() { _disposeViewModels() {
this._startSSOLoginViewModel = this.disposeTracked(this._ssoLoginViewModel); this._startSSOLoginViewModel = this.disposeTracked(this._ssoLoginViewModel);
this._passwordLoginViewModel = this.disposeTracked(this._passwordLoginViewModel); this._passwordLoginViewModel = this.disposeTracked(this._passwordLoginViewModel);