aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/video-add.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-20 14:29:55 +0100
committerChocobozzz <me@florianbigard.com>2017-12-20 14:29:55 +0100
commit15a7387da888492068e2ce3d1e39639d142f6c6e (patch)
tree8eaec71d11c19a97dc99e4d9812dfc0c646dd9e7 /client/src/app/videos/+video-edit/video-add.component.ts
parenta4b8a4ddccc926e0670d3687cccd52496f6f8a8f (diff)
downloadPeerTube-15a7387da888492068e2ce3d1e39639d142f6c6e.tar.gz
PeerTube-15a7387da888492068e2ce3d1e39639d142f6c6e.tar.zst
PeerTube-15a7387da888492068e2ce3d1e39639d142f6c6e.zip
Customize select
Diffstat (limited to 'client/src/app/videos/+video-edit/video-add.component.ts')
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.ts18
1 files changed, 4 insertions, 14 deletions
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts
index 90510d0dc..9bbee58d8 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -7,6 +7,7 @@ import { VideoPrivacy } from '../../../../../shared/models/videos'
7import { AuthService, ServerService } from '../../core' 7import { AuthService, ServerService } from '../../core'
8import { FormReactive } from '../../shared' 8import { FormReactive } from '../../shared'
9import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message' 9import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message'
10import { populateAsyncUserVideoChannels } from '../../shared/misc/utils'
10import { VideoEdit } from '../../shared/video/video-edit.model' 11import { VideoEdit } from '../../shared/video/video-edit.model'
11import { VideoService } from '../../shared/video/video.service' 12import { VideoService } from '../../shared/video/video.service'
12 13
@@ -59,6 +60,9 @@ export class VideoAddComponent extends FormReactive implements OnInit {
59 ngOnInit () { 60 ngOnInit () {
60 this.buildForm() 61 this.buildForm()
61 62
63 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels)
64 .then(() => this.firstStepChannelId = this.userVideoChannels[0].id)
65
62 this.serverService.videoPrivaciesLoaded 66 this.serverService.videoPrivaciesLoaded
63 .subscribe( 67 .subscribe(
64 () => { 68 () => {
@@ -67,20 +71,6 @@ export class VideoAddComponent extends FormReactive implements OnInit {
67 // Public by default 71 // Public by default
68 this.firstStepPrivacyId = VideoPrivacy.PUBLIC 72 this.firstStepPrivacyId = VideoPrivacy.PUBLIC
69 }) 73 })
70
71 this.authService.userInformationLoaded
72 .subscribe(
73 () => {
74 const user = this.authService.getUser()
75 if (!user) return
76
77 const videoChannels = user.videoChannels
78 if (Array.isArray(videoChannels) === false) return
79
80 this.userVideoChannels = videoChannels.map(v => ({ id: v.id, label: v.name }))
81 this.firstStepChannelId = this.userVideoChannels[0].id
82 }
83 )
84 } 74 }
85 75
86 fileChange () { 76 fileChange () {