]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-edit/video-update.component.ts
Use ng select for multiselect
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-edit / video-update.component.ts
index 7bd6eb553fd4ff4eeed9ef403bed2d75a933b325..abd08f05c17c8819bc152397d7dd98e02f824dbc 100644 (file)
@@ -2,7 +2,7 @@ import { map, switchMap } from 'rxjs/operators'
 import { Component, HostListener, OnInit } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
 import { Notifier } from '@app/core'
-import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
+import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms'
 import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main'
 import { LoadingBarService } from '@ngx-loading-bar/core'
 import { I18n } from '@ngx-translate/i18n-polyfill'
@@ -17,7 +17,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
   video: VideoEdit
 
   isUpdatingVideo = false
-  userVideoChannels: { id: number, label: string, support: string }[] = []
+  userVideoChannels: SelectChannelItem[] = []
   schedulePublicationPossible = false
   videoCaptions: VideoCaptionEdit[] = []
   waitTranscodingEnabled = true
@@ -101,7 +101,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
 
     this.video.patch(this.form.value)
 
-    this.loadingBar.start()
+    this.loadingBar.useRef().start()
     this.isUpdatingVideo = true
 
     // Update the video
@@ -114,13 +114,13 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
           () => {
             this.updateDone = true
             this.isUpdatingVideo = false
-            this.loadingBar.complete()
+            this.loadingBar.useRef().complete()
             this.notifier.success(this.i18n('Video updated.'))
             this.router.navigate([ '/videos/watch', this.video.uuid ])
           },
 
           err => {
-            this.loadingBar.complete()
+            this.loadingBar.useRef().complete()
             this.isUpdatingVideo = false
             this.notifier.error(err.message)
             console.error(err)