Do not display private privacy if the video is not private

pull/777/merge
Chocobozzz 2018-07-16 15:24:50 +02:00
parent 025c979467
commit 329d908660
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import { catchError, map } from 'rxjs/operators'
import { HttpClient } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { forkJoin, Observable } from 'rxjs'
import { forkJoin, Observable, of } from 'rxjs'
import { ResultList } from '../../../../../shared'
import { RestExtractor, RestService } from '../rest'
import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model'
@ -42,6 +42,8 @@ export class VideoCaptionService {
}
updateCaptions (videoId: number | string, videoCaptions: VideoCaptionEdit[]) {
if (videoCaptions.length === 0) return of(true)
const observables: Observable<any>[] = []
for (const videoCaption of videoCaptions) {

View File

@ -84,7 +84,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
// We cannot set private a video that was not private
if (this.video.privacy !== VideoPrivacy.PRIVATE) {
this.videoPrivacies = this.videoPrivacies.filter(p => p.id !== VideoPrivacy.PRIVATE)
this.videoPrivacies = this.videoPrivacies.filter(p => p.id.toString() !== VideoPrivacy.PRIVATE.toString())
} else { // We can schedule video publication only if it it is private
this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
}