diff options
author | Chocobozzz <me@florianbigard.com> | 2020-10-28 15:24:40 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | a056ca4813c82f490dcd31ac97a64d6bf76d3dcc (patch) | |
tree | 11a0638cb92eee94f404e294f54632212836a4a6 /client/src/app/+videos | |
parent | d846d99c6c81028bb7bd3cb20abd433cbf396a22 (diff) | |
download | PeerTube-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.ts | 13 |
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' | |||
7 | import { FormValidatorService } from '@app/shared/shared-forms' | 7 | import { FormValidatorService } from '@app/shared/shared-forms' |
8 | import { LiveVideoService, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' | 8 | import { LiveVideoService, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' |
9 | import { LoadingBarService } from '@ngx-loading-bar/core' | 9 | import { LoadingBarService } from '@ngx-loading-bar/core' |
10 | import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, VideoPrivacy } from '@shared/models' | 10 | import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, ServerErrorCode, VideoPrivacy } from '@shared/models' |
11 | import { VideoSend } from './video-send' | 11 | import { 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 | } |