From c0d3c950b02527d9f5d8c310d31cf2c7b08d342e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 23 Aug 2021 19:28:59 +0200 Subject: [PATCH] show the homeserver after lookup --- src/domain/login/LoginViewModel.js | 2 ++ src/platform/web/ui/css/themes/element/theme.css | 6 ++++++ src/platform/web/ui/login/LoginView.js | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/domain/login/LoginViewModel.js b/src/domain/login/LoginViewModel.js index d629241d..f2e9f0a5 100644 --- a/src/domain/login/LoginViewModel.js +++ b/src/domain/login/LoginViewModel.js @@ -49,6 +49,7 @@ export class LoginViewModel extends ViewModel { get startSSOLoginViewModel() { return this._startSSOLoginViewModel; } get completeSSOLoginViewModel(){ return this._completeSSOLoginViewModel; } get homeserver() { return this._homeserver; } + get forwardedHomeserver() { return this._loginOptions?.homeserver; } get errorMessage() { return this._errorMessage; } get showHomeserver() { return !this._hideHomeserver; } get loadViewModel() {return this._loadViewModel; } @@ -203,6 +204,7 @@ export class LoginViewModel extends ViewModel { this._abortQueryOperation = this.track(() => queryOperation.abort()); this.emitChange("isFetchingLoginOptions"); this._loginOptions = await queryOperation.result; + this.emitChange("forwardedHomeserver"); } catch (e) { if (e.name === "AbortError") { diff --git a/src/platform/web/ui/css/themes/element/theme.css b/src/platform/web/ui/css/themes/element/theme.css index 08f1df06..1b0bc9e4 100644 --- a/src/platform/web/ui/css/themes/element/theme.css +++ b/src/platform/web/ui/css/themes/element/theme.css @@ -238,6 +238,12 @@ a.button-action { font-size: 1.5rem; } +.LoginView_forwardInfo { + font-size: 0.9em; + margin-left: 1em; + color: #777; +} + .CompleteSSOView_title { font-weight: 500; } diff --git a/src/platform/web/ui/login/LoginView.js b/src/platform/web/ui/login/LoginView.js index 4e4f1061..fc2bf686 100644 --- a/src/platform/web/ui/login/LoginView.js +++ b/src/platform/web/ui/login/LoginView.js @@ -46,6 +46,10 @@ export class LoginView extends TemplateView { onInput: event => vm.setHomeserver(event.target.value), 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))), ] )),