mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
don't requery the same homeserver we just did
This commit is contained in:
parent
e0d53e57ba
commit
3dbffdb417
@ -36,6 +36,7 @@ export class LoginViewModel extends ViewModel {
|
|||||||
this._loadViewModel = null;
|
this._loadViewModel = null;
|
||||||
this._loadViewModelSubscription = null;
|
this._loadViewModelSubscription = null;
|
||||||
this._homeserver = defaultHomeserver;
|
this._homeserver = defaultHomeserver;
|
||||||
|
this._queriedHomeserver = null;
|
||||||
this._errorMessage = "";
|
this._errorMessage = "";
|
||||||
this._hideHomeserver = false;
|
this._hideHomeserver = false;
|
||||||
this._isBusy = false;
|
this._isBusy = false;
|
||||||
@ -183,6 +184,11 @@ export class LoginViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async queryHomeserver() {
|
async queryHomeserver() {
|
||||||
|
// don't repeat a query we've just done
|
||||||
|
if (this._homeserver === this._queriedHomeserver || this._homeserver === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._queriedHomeserver = this._homeserver;
|
||||||
// given that setHomeserver already clears everything set here,
|
// given that setHomeserver already clears everything set here,
|
||||||
// and that is the only way to change the homeserver,
|
// and that is the only way to change the homeserver,
|
||||||
// we don't need to reset things again here.
|
// we don't need to reset things again here.
|
||||||
|
Loading…
Reference in New Issue
Block a user