aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/video
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-26 14:03:21 +0200
committerChocobozzz <me@florianbigard.com>2021-07-26 14:03:46 +0200
commitd91714ca56f7baa2f0eff02f7c1ef2b891096171 (patch)
treeec542f1f89f8679e1a9aafa0a9f5224c58d9b5d1 /client/src/app/shared/shared-main/video
parenta66424978c681af87aaee92ce6d2ca600d79b82c (diff)
downloadPeerTube-d91714ca56f7baa2f0eff02f7c1ef2b891096171.tar.gz
PeerTube-d91714ca56f7baa2f0eff02f7c1ef2b891096171.tar.zst
PeerTube-d91714ca56f7baa2f0eff02f7c1ef2b891096171.zip
Fix privacy descriptions
Diffstat (limited to 'client/src/app/shared/shared-main/video')
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts34
1 files changed, 15 insertions, 19 deletions
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index 49d6fc1c7..04a39be0e 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -379,28 +379,24 @@ export class VideoService implements VideosProvider {
379 } 379 }
380 380
381 explainedPrivacyLabels (serverPrivacies: VideoConstant<VideoPrivacy>[], defaultPrivacyId = VideoPrivacy.PUBLIC) { 381 explainedPrivacyLabels (serverPrivacies: VideoConstant<VideoPrivacy>[], defaultPrivacyId = VideoPrivacy.PUBLIC) {
382 const descriptions = [ 382 const descriptions = {
383 { 383 [VideoPrivacy.PRIVATE]: $localize`Only I can see this video`,
384 id: VideoPrivacy.PRIVATE, 384 [VideoPrivacy.UNLISTED]: $localize`Only shareable via a private link`,
385 description: $localize`Only I can see this video` 385 [VideoPrivacy.PUBLIC]: $localize`Anyone can see this video`,
386 }, 386 [VideoPrivacy.INTERNAL]: $localize`Only users of this instance can see this video`
387 { 387 }
388 id: VideoPrivacy.UNLISTED, 388
389 description: $localize`Only shareable via a private link` 389 const videoPrivacies = serverPrivacies.map(p => {
390 }, 390 return {
391 { 391 ...p,
392 id: VideoPrivacy.PUBLIC, 392
393 description: $localize`Anyone can see this video` 393 description: descriptions[p.id]
394 },
395 {
396 id: VideoPrivacy.INTERNAL,
397 description: $localize`Only users of this instance can see this video`
398 } 394 }
399 ] 395 })
400 396
401 return { 397 return {
402 defaultPrivacyId: serverPrivacies.find(p => p.id === defaultPrivacyId)?.id || serverPrivacies[0].id, 398 videoPrivacies,
403 videoPrivacies: serverPrivacies.map(p => ({ ...p, description: descriptions.find(p => p.id).description })) 399 defaultPrivacyId: serverPrivacies.find(p => p.id === defaultPrivacyId)?.id || serverPrivacies[0].id
404 } 400 }
405 } 401 }
406 402