aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+signup/+register/register.component.ts
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2020-12-03 07:59:37 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-03 09:54:41 +0100
commit09c55770bcc96785fb1f199b4cd8ce66b545486a (patch)
tree04a94f68b48539ae6f541fa3dc72a97ef9235540 /client/src/app/+signup/+register/register.component.ts
parentffc12d3ad5b832602b1098cd3d601feeb618af7c (diff)
downloadPeerTube-09c55770bcc96785fb1f199b4cd8ce66b545486a.tar.gz
PeerTube-09c55770bcc96785fb1f199b4cd8ce66b545486a.tar.zst
PeerTube-09c55770bcc96785fb1f199b4cd8ce66b545486a.zip
register: hide channel step if upload quota is 0
fix #782
Diffstat (limited to 'client/src/app/+signup/+register/register.component.ts')
-rw-r--r--client/src/app/+signup/+register/register.component.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/app/+signup/+register/register.component.ts b/client/src/app/+signup/+register/register.component.ts
index 153a6d2b5..5b6762631 100644
--- a/client/src/app/+signup/+register/register.component.ts
+++ b/client/src/app/+signup/+register/register.component.ts
@@ -30,6 +30,8 @@ export class RegisterComponent implements OnInit {
30 administrator: '' 30 administrator: ''
31 } 31 }
32 32
33 videoUploadDisabled: boolean
34
33 formStepUser: FormGroup 35 formStepUser: FormGroup
34 formStepChannel: FormGroup 36 formStepChannel: FormGroup
35 37
@@ -52,6 +54,8 @@ export class RegisterComponent implements OnInit {
52 ngOnInit (): void { 54 ngOnInit (): void {
53 this.serverConfig = this.route.snapshot.data.serverConfig 55 this.serverConfig = this.route.snapshot.data.serverConfig
54 56
57 this.videoUploadDisabled = this.serverConfig.user.videoQuota === 0
58
55 this.instanceService.getAbout() 59 this.instanceService.getAbout()
56 .subscribe( 60 .subscribe(
57 async about => { 61 async about => {
@@ -102,7 +106,7 @@ export class RegisterComponent implements OnInit {
102 this.error = null 106 this.error = null
103 107
104 const body: UserRegister = await this.hooks.wrapObject( 108 const body: UserRegister = await this.hooks.wrapObject(
105 Object.assign(this.formStepUser.value, { channel: this.formStepChannel.value }), 109 Object.assign(this.formStepUser.value, { channel: this.videoUploadDisabled ? undefined : this.formStepChannel.value }),
106 'signup', 110 'signup',
107 'filter:api.signup.registration.create.params' 111 'filter:api.signup.registration.create.params'
108 ) 112 )