mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Move logic to vm
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
068fba3616
commit
daf7af17b1
@ -41,6 +41,7 @@ export class LoginViewModel extends ViewModel {
|
|||||||
get completeSSOLoginViewModel(){ return this._completeSSOLoginViewModel; }
|
get completeSSOLoginViewModel(){ return this._completeSSOLoginViewModel; }
|
||||||
get defaultHomeServer() { return this._homeserver; }
|
get defaultHomeServer() { return this._homeserver; }
|
||||||
get errorMessage() { return this._errorMessage; }
|
get errorMessage() { return this._errorMessage; }
|
||||||
|
get showHomeserver() { return !this._completeSSOLoginViewModel; }
|
||||||
|
|
||||||
async _createViewModels(homeserver) {
|
async _createViewModels(homeserver) {
|
||||||
if (this._loginToken) {
|
if (this._loginToken) {
|
||||||
|
@ -33,7 +33,7 @@ export class LoginView extends TemplateView {
|
|||||||
t.div({className: "logo"}),
|
t.div({className: "logo"}),
|
||||||
t.h1([vm.i18n`Sign In`]),
|
t.h1([vm.i18n`Sign In`]),
|
||||||
t.mapView(vm => vm.completeSSOLoginViewModel, vm => vm ? new CompleteSSOView(vm) : null),
|
t.mapView(vm => vm.completeSSOLoginViewModel, vm => vm ? new CompleteSSOView(vm) : null),
|
||||||
t.if(vm => !vm.completeSSOLoginViewModel,
|
t.if(vm => vm.showHomeserver,
|
||||||
(t, vm) => t.div({ className: "LoginView_sso form form-row" }, [t.label({ for: "homeserver" }, vm.i18n`Homeserver`), homeserver])),
|
(t, vm) => t.div({ className: "LoginView_sso form form-row" }, [t.label({ for: "homeserver" }, vm.i18n`Homeserver`), homeserver])),
|
||||||
t.mapView(vm => vm.passwordLoginViewModel, vm => vm ? new PasswordLoginView(vm): null),
|
t.mapView(vm => vm.passwordLoginViewModel, vm => vm ? new PasswordLoginView(vm): null),
|
||||||
t.if(vm => vm.passwordLoginViewModel && vm.startSSOLoginViewModel, t => t.p({className: "LoginView_separator"}, vm.i18n`or`)),
|
t.if(vm => vm.passwordLoginViewModel && vm.startSSOLoginViewModel, t => t.p({className: "LoginView_separator"}, vm.i18n`or`)),
|
||||||
|
Loading…
Reference in New Issue
Block a user