Fix infinite scroll on big screens
[oweals/peertube.git] / client / src / app / +my-account / my-account-video-channels / my-account-video-channel-update.component.ts
index da4fb645ae92e8b73b20a5918e67be46bc708c99..081e956d27e6d1fefc8ca8af72d6dae6de7b4928 100644 (file)
@@ -20,6 +20,7 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
   videoChannelToUpdate: VideoChannel
 
   private paramsSub: Subscription
+  private oldSupportField: string
 
   constructor (
     protected formValidatorService: FormValidatorService,
@@ -39,7 +40,8 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
     this.buildForm({
       'display-name': this.videoChannelValidatorsService.VIDEO_CHANNEL_DISPLAY_NAME,
       description: this.videoChannelValidatorsService.VIDEO_CHANNEL_DESCRIPTION,
-      support: this.videoChannelValidatorsService.VIDEO_CHANNEL_SUPPORT
+      support: this.videoChannelValidatorsService.VIDEO_CHANNEL_SUPPORT,
+      bulkVideosSupportUpdate: null
     })
 
     this.paramsSub = this.route.params.subscribe(routeParams => {
@@ -49,6 +51,8 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
         videoChannelToUpdate => {
           this.videoChannelToUpdate = videoChannelToUpdate
 
+          this.oldSupportField = videoChannelToUpdate.support
+
           this.form.patchValue({
             'display-name': videoChannelToUpdate.displayName,
             description: videoChannelToUpdate.description,
@@ -72,7 +76,8 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
     const videoChannelUpdate: VideoChannelUpdate = {
       displayName: body['display-name'],
       description: body.description || null,
-      support: body.support || null
+      support: body.support || null,
+      bulkVideosSupportUpdate: body.bulkVideosSupportUpdate || false
     }
 
     this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.name, videoChannelUpdate).subscribe(
@@ -118,4 +123,10 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
   getFormButtonTitle () {
     return this.i18n('Update')
   }
+
+  isBulkUpdateVideosDisplayed () {
+    if (this.oldSupportField === undefined) return false
+
+    return this.oldSupportField !== this.form.value['support']
+  }
 }