show the homeserver after lookup

This commit is contained in:
Bruno Windels 2021-08-23 19:28:59 +02:00
parent 3dbffdb417
commit c0d3c950b0
3 changed files with 12 additions and 0 deletions

View File

@ -49,6 +49,7 @@ export class LoginViewModel extends ViewModel {
get startSSOLoginViewModel() { return this._startSSOLoginViewModel; } get startSSOLoginViewModel() { return this._startSSOLoginViewModel; }
get completeSSOLoginViewModel(){ return this._completeSSOLoginViewModel; } get completeSSOLoginViewModel(){ return this._completeSSOLoginViewModel; }
get homeserver() { return this._homeserver; } get homeserver() { return this._homeserver; }
get forwardedHomeserver() { return this._loginOptions?.homeserver; }
get errorMessage() { return this._errorMessage; } get errorMessage() { return this._errorMessage; }
get showHomeserver() { return !this._hideHomeserver; } get showHomeserver() { return !this._hideHomeserver; }
get loadViewModel() {return this._loadViewModel; } get loadViewModel() {return this._loadViewModel; }
@ -203,6 +204,7 @@ export class LoginViewModel extends ViewModel {
this._abortQueryOperation = this.track(() => queryOperation.abort()); this._abortQueryOperation = this.track(() => queryOperation.abort());
this.emitChange("isFetchingLoginOptions"); this.emitChange("isFetchingLoginOptions");
this._loginOptions = await queryOperation.result; this._loginOptions = await queryOperation.result;
this.emitChange("forwardedHomeserver");
} }
catch (e) { catch (e) {
if (e.name === "AbortError") { if (e.name === "AbortError") {

View File

@ -238,6 +238,12 @@ a.button-action {
font-size: 1.5rem; font-size: 1.5rem;
} }
.LoginView_forwardInfo {
font-size: 0.9em;
margin-left: 1em;
color: #777;
}
.CompleteSSOView_title { .CompleteSSOView_title {
font-weight: 500; font-weight: 500;
} }

View File

@ -46,6 +46,10 @@ export class LoginView extends TemplateView {
onInput: event => vm.setHomeserver(event.target.value), onInput: event => vm.setHomeserver(event.target.value),
onChange: () => vm.queryHomeserver(), onChange: () => vm.queryHomeserver(),
}), }),
t.p({className: {
LoginView_forwardInfo: true,
hidden: vm => !vm.forwardedHomeserver
}}, vm => vm.i18n`${vm.homeserver} forwards to ${vm.forwardedHomeserver}.`),
t.if(vm => vm.errorMessage, (t, vm) => t.p({className: "error"}, vm.i18n(vm.errorMessage))), t.if(vm => vm.errorMessage, (t, vm) => t.p({className: "error"}, vm.i18n(vm.errorMessage))),
] ]
)), )),