X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-video-miniature%2Fvideo-actions-dropdown.component.ts;h=2ba091438bf003111c6803f29f03c634954cc381;hb=1378c0d343028f3d40d7d795422684ab9e6a1599;hp=18b4a2f3c2e112b38e125b061ed1a02ece256de7;hpb=f8c00564e7e66c7c9d65ea044a4c1485df0e4c7c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts index 18b4a2f3c..2ba091438 100644 --- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts @@ -93,7 +93,7 @@ export class VideoActionsDropdownComponent implements OnChanges { ngOnChanges () { if (this.loaded) { this.loaded = false - this.playlistAdd.reload() + if (this.playlistAdd) this.playlistAdd.reload() } this.buildActions() @@ -167,7 +167,7 @@ export class VideoActionsDropdownComponent implements OnChanges { } canVideoBeDuplicated () { - return this.video.canBeDuplicatedBy(this.user) + return !this.video.isLive && this.video.canBeDuplicatedBy(this.user) } isVideoAccountMutable () { @@ -183,8 +183,8 @@ export class VideoActionsDropdownComponent implements OnChanges { if (res === false) return this.videoBlocklistService.unblockVideo(this.video.id) - .subscribe( - () => { + .subscribe({ + next: () => { this.notifier.success($localize`Video ${this.video.name} unblocked.`) this.video.blacklisted = false @@ -193,8 +193,8 @@ export class VideoActionsDropdownComponent implements OnChanges { this.videoUnblocked.emit() }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } async removeVideo () { @@ -209,40 +209,40 @@ export class VideoActionsDropdownComponent implements OnChanges { if (res === false) return this.videoService.removeVideo(this.video.id) - .subscribe( - () => { + .subscribe({ + next: () => { this.notifier.success($localize`Video ${this.video.name} deleted.`) this.videoRemoved.emit() }, - error => this.notifier.error(error.message) - ) + error: err => this.notifier.error(err.message) + }) } duplicateVideo () { this.redundancyService.addVideoRedundancy(this.video) - .subscribe( - () => { + .subscribe({ + next: () => { const message = $localize`This video will be duplicated by your instance.` this.notifier.success(message) }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } muteVideoAccount () { const params = { nameWithHost: Actor.CREATE_BY_STRING(this.video.account.name, this.video.account.host) } this.blocklistService.blockAccountByUser(params) - .subscribe( - () => { + .subscribe({ + next: () => { this.notifier.success($localize`Account ${params.nameWithHost} muted.`) this.videoAccountMuted.emit() }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } onVideoBlocked () { @@ -277,7 +277,7 @@ export class VideoActionsDropdownComponent implements OnChanges { { label: $localize`Display live information`, handler: ({ video }) => this.showLiveInfoModal(video), - isDisplayed: () => this.isVideoLiveInfoAvailable(), + isDisplayed: () => this.displayOptions.liveInfo && this.isVideoLiveInfoAvailable(), iconName: 'live' }, {