diff options
Diffstat (limited to 'client/src/app/videos/+video-edit/video-update.component.ts')
-rw-r--r-- | client/src/app/videos/+video-edit/video-update.component.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index 0266164af..c4e6f44de 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts | |||
@@ -24,6 +24,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
24 | isUpdatingVideo = false | 24 | isUpdatingVideo = false |
25 | videoPrivacies = [] | 25 | videoPrivacies = [] |
26 | userVideoChannels = [] | 26 | userVideoChannels = [] |
27 | schedulePublicationPossible = false | ||
27 | 28 | ||
28 | constructor ( | 29 | constructor ( |
29 | protected formValidatorService: FormValidatorService, | 30 | protected formValidatorService: FormValidatorService, |
@@ -70,13 +71,10 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
70 | this.userVideoChannels = videoChannels | 71 | this.userVideoChannels = videoChannels |
71 | 72 | ||
72 | // We cannot set private a video that was not private | 73 | // We cannot set private a video that was not private |
73 | if (video.privacy.id !== VideoPrivacy.PRIVATE) { | 74 | if (this.video.privacy !== VideoPrivacy.PRIVATE) { |
74 | const newVideoPrivacies = [] | 75 | this.videoPrivacies = this.videoPrivacies.filter(p => p.id !== VideoPrivacy.PRIVATE) |
75 | for (const p of this.videoPrivacies) { | 76 | } else { // We can schedule video publication only if it it is private |
76 | if (p.id !== VideoPrivacy.PRIVATE) newVideoPrivacies.push(p) | 77 | this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE |
77 | } | ||
78 | |||
79 | this.videoPrivacies = newVideoPrivacies | ||
80 | } | 78 | } |
81 | 79 | ||
82 | this.hydrateFormFromVideo() | 80 | this.hydrateFormFromVideo() |
@@ -123,7 +121,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
123 | } | 121 | } |
124 | 122 | ||
125 | private hydrateFormFromVideo () { | 123 | private hydrateFormFromVideo () { |
126 | this.form.patchValue(this.video.toJSON()) | 124 | this.form.patchValue(this.video.toFormPatch()) |
127 | 125 | ||
128 | const objects = [ | 126 | const objects = [ |
129 | { | 127 | { |