aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+signup
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/+signup
parent5dfb7c1dec8222b0bbccac5b56ad46da1438747e (diff)
downloadPeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.gz
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.zst
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.zip
Lazy load static objects
Diffstat (limited to 'client/src/app/+signup')
-rw-r--r--client/src/app/+signup/+register/register-routing.module.ts2
-rw-r--r--client/src/app/+signup/+register/register.component.ts10
-rw-r--r--client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts8
3 files changed, 16 insertions, 4 deletions
diff --git a/client/src/app/+signup/+register/register-routing.module.ts b/client/src/app/+signup/+register/register-routing.module.ts
index e3a5001dc..f47e80755 100644
--- a/client/src/app/+signup/+register/register-routing.module.ts
+++ b/client/src/app/+signup/+register/register-routing.module.ts
@@ -16,7 +16,7 @@ const registerRoutes: Routes = [
16 } 16 }
17 }, 17 },
18 resolve: { 18 resolve: {
19 serverConfigLoaded: ServerConfigResolver 19 serverConfig: ServerConfigResolver
20 } 20 }
21 } 21 }
22] 22]
diff --git a/client/src/app/+signup/+register/register.component.ts b/client/src/app/+signup/+register/register.component.ts
index acec56f04..ae944ec15 100644
--- a/client/src/app/+signup/+register/register.component.ts
+++ b/client/src/app/+signup/+register/register.component.ts
@@ -4,10 +4,11 @@ import { UserService, UserValidatorsService } from '@app/shared'
4import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { UserRegister } from '@shared/models/users/user-register.model' 5import { UserRegister } from '@shared/models/users/user-register.model'
6import { FormGroup } from '@angular/forms' 6import { FormGroup } from '@angular/forms'
7import { About } from '@shared/models/server' 7import { About, ServerConfig } from '@shared/models/server'
8import { InstanceService } from '@app/shared/instance/instance.service' 8import { InstanceService } from '@app/shared/instance/instance.service'
9import { HooksService } from '@app/core/plugins/hooks.service' 9import { HooksService } from '@app/core/plugins/hooks.service'
10import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap' 10import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap'
11import { ActivatedRoute } from '@angular/router'
11 12
12@Component({ 13@Component({
13 selector: 'my-register', 14 selector: 'my-register',
@@ -34,7 +35,10 @@ export class RegisterComponent implements OnInit {
34 formStepUser: FormGroup 35 formStepUser: FormGroup
35 formStepChannel: FormGroup 36 formStepChannel: FormGroup
36 37
38 private serverConfig: ServerConfig
39
37 constructor ( 40 constructor (
41 private route: ActivatedRoute,
38 private authService: AuthService, 42 private authService: AuthService,
39 private userValidatorsService: UserValidatorsService, 43 private userValidatorsService: UserValidatorsService,
40 private notifier: Notifier, 44 private notifier: Notifier,
@@ -48,10 +52,12 @@ export class RegisterComponent implements OnInit {
48 } 52 }
49 53
50 get requiresEmailVerification () { 54 get requiresEmailVerification () {
51 return this.serverService.getConfig().signup.requiresEmailVerification 55 return this.serverConfig.signup.requiresEmailVerification
52 } 56 }
53 57
54 ngOnInit (): void { 58 ngOnInit (): void {
59 this.serverConfig = this.route.snapshot.data.serverConfig
60
55 this.instanceService.getAbout() 61 this.instanceService.getAbout()
56 .subscribe( 62 .subscribe(
57 async about => { 63 async about => {
diff --git a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts
index cfd471fa4..3bd604b66 100644
--- a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts
+++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts
@@ -5,6 +5,7 @@ import { ServerService } from '@app/core/server'
5import { FormReactive, UserService } from '@app/shared' 5import { FormReactive, UserService } from '@app/shared'
6import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 6import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
7import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' 7import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
8import { ServerConfig } from '@shared/models'
8 9
9@Component({ 10@Component({
10 selector: 'my-verify-account-ask-send-email', 11 selector: 'my-verify-account-ask-send-email',
@@ -13,6 +14,7 @@ import { UserValidatorsService } from '@app/shared/forms/form-validators/user-va
13}) 14})
14 15
15export class VerifyAccountAskSendEmailComponent extends FormReactive implements OnInit { 16export class VerifyAccountAskSendEmailComponent extends FormReactive implements OnInit {
17 private serverConfig: ServerConfig
16 18
17 constructor ( 19 constructor (
18 protected formValidatorService: FormValidatorService, 20 protected formValidatorService: FormValidatorService,
@@ -27,10 +29,14 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements
27 } 29 }
28 30
29 get requiresEmailVerification () { 31 get requiresEmailVerification () {
30 return this.serverService.getConfig().signup.requiresEmailVerification 32 return this.serverConfig.signup.requiresEmailVerification
31 } 33 }
32 34
33 ngOnInit () { 35 ngOnInit () {
36 this.serverConfig = this.serverService.getTmpConfig()
37 this.serverService.getConfig()
38 .subscribe(config => this.serverConfig = config)
39
34 this.buildForm({ 40 this.buildForm({
35 'verify-email-email': this.userValidatorsService.USER_EMAIL 41 'verify-email-email': this.userValidatorsService.USER_EMAIL
36 }) 42 })