]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+signup/+register/register.component.ts
Fix viewers for lives
[github/Chocobozzz/PeerTube.git] / client / src / app / +signup / +register / register.component.ts
index 153a6d2b580ea57f0fd7811783038729b9b6810e..5b6762631dcb7074866a02179fecc2b4d283f3b5 100644 (file)
@@ -30,6 +30,8 @@ export class RegisterComponent implements OnInit {
     administrator: ''
   }
 
+  videoUploadDisabled: boolean
+
   formStepUser: FormGroup
   formStepChannel: FormGroup
 
@@ -52,6 +54,8 @@ export class RegisterComponent implements OnInit {
   ngOnInit (): void {
     this.serverConfig = this.route.snapshot.data.serverConfig
 
+    this.videoUploadDisabled = this.serverConfig.user.videoQuota === 0
+
     this.instanceService.getAbout()
       .subscribe(
         async about => {
@@ -102,7 +106,7 @@ export class RegisterComponent implements OnInit {
     this.error = null
 
     const body: UserRegister = await this.hooks.wrapObject(
-      Object.assign(this.formStepUser.value, { channel: this.formStepChannel.value }),
+      Object.assign(this.formStepUser.value, { channel: this.videoUploadDisabled ? undefined : this.formStepChannel.value }),
       'signup',
       'filter:api.signup.registration.create.params'
     )