X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2Fvideo-watch%2Fvideo-watch.component.ts;h=07b2a1d1f30736f80823c0683500901bef2ef8dc;hb=ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd;hp=f582df45cdf4950ca410eba7fc2d8763b71560bc;hpb=198b205c10dba362b9ae1ef6895b29d7e0dd685f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts index f582df45c..07b2a1d1f 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts @@ -171,41 +171,43 @@ export class VideoWatchComponent implements OnInit, OnDestroy { removeVideo(event: Event) { event.preventDefault(); + this.confirmService.confirm('Do you really want to delete this video?', 'Delete').subscribe( res => { if (res === false) return; this.videoService.removeVideo(this.video.id) - .subscribe( - status => { - this.notificationsService.success('Success', `Video ${this.video.name} deleted.`) - // Go back to the video-list. - this.router.navigate(['/videos/list']) - }, - - error => this.notificationsService.error('Error', error.text) - ); + .subscribe( + status => { + this.notificationsService.success('Success', `Video ${this.video.name} deleted.`); + // Go back to the video-list. + this.router.navigate(['/videos/list']); + }, + + error => this.notificationsService.error('Error', error.text) + ); } ); } blacklistVideo(event: Event) { - event.preventDefault() + event.preventDefault(); + this.confirmService.confirm('Do you really want to blacklist this video ?', 'Blacklist').subscribe( res => { - if (res === false) return; + if (res === false) return; - this.videoService.blacklistVideo(this.video.id) - .subscribe( - status => { - this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) - this.router.navigate(['/videos/list']) - }, + this.videoService.blacklistVideo(this.video.id) + .subscribe( + status => { + this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`); + this.router.navigate(['/videos/list']); + }, - error => this.notificationsService.error('Error', error.text) - ) + error => this.notificationsService.error('Error', error.text) + ); } - ) + ); } showReportModal(event: Event) {