aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-10-28 15:24:40 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commita056ca4813c82f490dcd31ac97a64d6bf76d3dcc (patch)
tree11a0638cb92eee94f404e294f54632212836a4a6 /client/src/app/+videos
parentd846d99c6c81028bb7bd3cb20abd433cbf396a22 (diff)
downloadPeerTube-a056ca4813c82f490dcd31ac97a64d6bf76d3dcc.tar.gz
PeerTube-a056ca4813c82f490dcd31ac97a64d6bf76d3dcc.tar.zst
PeerTube-a056ca4813c82f490dcd31ac97a64d6bf76d3dcc.zip
Add max lives limit
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
index 9868c37d2..870a70d3d 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
@@ -7,7 +7,7 @@ import { scrollToTop } from '@app/helpers'
7import { FormValidatorService } from '@app/shared/shared-forms' 7import { FormValidatorService } from '@app/shared/shared-forms'
8import { LiveVideoService, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' 8import { LiveVideoService, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
9import { LoadingBarService } from '@ngx-loading-bar/core' 9import { LoadingBarService } from '@ngx-loading-bar/core'
10import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, VideoPrivacy } from '@shared/models' 10import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, ServerErrorCode, VideoPrivacy } from '@shared/models'
11import { VideoSend } from './video-send' 11import { VideoSend } from './video-send'
12 12
13@Component({ 13@Component({
@@ -81,7 +81,16 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, CanCompon
81 81
82 err => { 82 err => {
83 this.firstStepError.emit() 83 this.firstStepError.emit()
84 this.notifier.error(err.message) 84
85 let message = err.message
86
87 if (err.body?.code === ServerErrorCode.MAX_INSTANCE_LIVES_LIMIT_REACHED) {
88 message = $localize`Cannot create live because this instance have too many created lives`
89 } else if (err.body?.code) {
90 message = $localize`Cannot create live because you created too many lives`
91 }
92
93 this.notifier.error(message)
85 } 94 }
86 ) 95 )
87 } 96 }