aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/login
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-18 15:31:54 +0100
committerChocobozzz <me@florianbigard.com>2019-12-18 15:40:59 +0100
commitba430d7516bc5b1324b60571ba7594460969b7fb (patch)
treedf5c6952c82f49a94c0a884bbc97d4a0cbd9f867 /client/src/app/login
parent5dfb7c1dec8222b0bbccac5b56ad46da1438747e (diff)
downloadPeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.gz
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.zst
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.zip
Lazy load static objects
Diffstat (limited to 'client/src/app/login')
-rw-r--r--client/src/app/login/login-routing.module.ts2
-rw-r--r--client/src/app/login/login.component.ts13
2 files changed, 10 insertions, 5 deletions
diff --git a/client/src/app/login/login-routing.module.ts b/client/src/app/login/login-routing.module.ts
index 5a41f4e7e..22f59b4d9 100644
--- a/client/src/app/login/login-routing.module.ts
+++ b/client/src/app/login/login-routing.module.ts
@@ -15,7 +15,7 @@ const loginRoutes: Routes = [
15 } 15 }
16 }, 16 },
17 resolve: { 17 resolve: {
18 serverConfigLoaded: ServerConfigResolver 18 serverConfig: ServerConfigResolver
19 } 19 }
20 } 20 }
21] 21]
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'
7import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 7import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
8import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' 8import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service'
9import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' 9import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
10import { Router } from '@angular/router' 10import { ActivatedRoute, Router } from '@angular/router'
11import { 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