diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-18 15:31:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-18 15:40:59 +0100 |
commit | ba430d7516bc5b1324b60571ba7594460969b7fb (patch) | |
tree | df5c6952c82f49a94c0a884bbc97d4a0cbd9f867 /client/src/app/login/login.component.ts | |
parent | 5dfb7c1dec8222b0bbccac5b56ad46da1438747e (diff) | |
download | PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.gz PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.zst PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.zip |
Lazy load static objects
Diffstat (limited to 'client/src/app/login/login.component.ts')
-rw-r--r-- | client/src/app/login/login.component.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index 911b9982f..cf923492a 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts | |||
@@ -7,7 +7,8 @@ import { I18n } from '@ngx-translate/i18n-polyfill' | |||
7 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 7 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
8 | import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' | 8 | import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' |
9 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | 9 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' |
10 | import { Router } from '@angular/router' | 10 | import { ActivatedRoute, Router } from '@angular/router' |
11 | import { ServerConfig } from '@shared/models' | ||
11 | 12 | ||
12 | @Component({ | 13 | @Component({ |
13 | selector: 'my-login', | 14 | selector: 'my-login', |
@@ -23,10 +24,12 @@ export class LoginComponent extends FormReactive implements OnInit { | |||
23 | forgotPasswordEmail = '' | 24 | forgotPasswordEmail = '' |
24 | 25 | ||
25 | private openedForgotPasswordModal: NgbModalRef | 26 | private openedForgotPasswordModal: NgbModalRef |
27 | private serverConfig: ServerConfig | ||
26 | 28 | ||
27 | constructor ( | 29 | constructor ( |
28 | public router: Router, | ||
29 | protected formValidatorService: FormValidatorService, | 30 | protected formValidatorService: FormValidatorService, |
31 | private router: Router, | ||
32 | private route: ActivatedRoute, | ||
30 | private modalService: NgbModal, | 33 | private modalService: NgbModal, |
31 | private loginValidatorsService: LoginValidatorsService, | 34 | private loginValidatorsService: LoginValidatorsService, |
32 | private authService: AuthService, | 35 | private authService: AuthService, |
@@ -40,14 +43,16 @@ export class LoginComponent extends FormReactive implements OnInit { | |||
40 | } | 43 | } |
41 | 44 | ||
42 | get signupAllowed () { | 45 | get signupAllowed () { |
43 | return this.serverService.getConfig().signup.allowed === true | 46 | return this.serverConfig.signup.allowed === true |
44 | } | 47 | } |
45 | 48 | ||
46 | isEmailDisabled () { | 49 | isEmailDisabled () { |
47 | return this.serverService.getConfig().email.enabled === false | 50 | return this.serverConfig.email.enabled === false |
48 | } | 51 | } |
49 | 52 | ||
50 | ngOnInit () { | 53 | ngOnInit () { |
54 | this.serverConfig = this.route.snapshot.data.serverConfig | ||
55 | |||
51 | this.buildForm({ | 56 | this.buildForm({ |
52 | username: this.loginValidatorsService.LOGIN_USERNAME, | 57 | username: this.loginValidatorsService.LOGIN_USERNAME, |
53 | password: this.loginValidatorsService.LOGIN_PASSWORD | 58 | password: this.loginValidatorsService.LOGIN_PASSWORD |