aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-list/video-miniature.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/video-list/video-miniature.component.ts')
-rw-r--r--client/src/app/videos/video-list/video-miniature.component.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/src/app/videos/video-list/video-miniature.component.ts b/client/src/app/videos/video-list/video-miniature.component.ts
index 398d2db75..ca4afc451 100644
--- a/client/src/app/videos/video-list/video-miniature.component.ts
+++ b/client/src/app/videos/video-list/video-miniature.component.ts
@@ -1,5 +1,7 @@
1import { Component, Input, Output, EventEmitter } from '@angular/core'; 1import { Component, Input, Output, EventEmitter } from '@angular/core';
2 2
3import { NotificationsService } from 'angular2-notifications';
4
3import { SortField, Video, VideoService } from '../shared'; 5import { SortField, Video, VideoService } from '../shared';
4import { User } from '../../shared'; 6import { User } from '../../shared';
5 7
@@ -18,7 +20,10 @@ export class VideoMiniatureComponent {
18 20
19 hovering = false; 21 hovering = false;
20 22
21 constructor(private videoService: VideoService) {} 23 constructor(
24 private notificationsService: NotificationsService,
25 private videoService: VideoService
26 ) {}
22 27
23 displayRemoveIcon() { 28 displayRemoveIcon() {
24 return this.hovering && this.video.isRemovableBy(this.user); 29 return this.hovering && this.video.isRemovableBy(this.user);
@@ -36,7 +41,8 @@ export class VideoMiniatureComponent {
36 if (confirm('Do you really want to remove this video?')) { 41 if (confirm('Do you really want to remove this video?')) {
37 this.videoService.removeVideo(id).subscribe( 42 this.videoService.removeVideo(id).subscribe(
38 status => this.removed.emit(true), 43 status => this.removed.emit(true),
39 error => alert(error.text) 44
45 error => this.notificationsService.error('Error', error.text)
40 ); 46 );
41 } 47 }
42 } 48 }