diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 16:14:11 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 16:14:11 +0100 |
commit | 7ddd02c9b8c1e088f6679a2227f105e6439fc992 (patch) | |
tree | a1ff7af17f2a95abe85a2380834957e44032e8c2 /client/src/app/+admin/friends/friend-list/friend-list.component.ts | |
parent | cddadde81f91219204cec1f4057a191c02a70894 (diff) | |
download | PeerTube-7ddd02c9b8c1e088f6679a2227f105e6439fc992.tar.gz PeerTube-7ddd02c9b8c1e088f6679a2227f105e6439fc992.tar.zst PeerTube-7ddd02c9b8c1e088f6679a2227f105e6439fc992.zip |
Client: better notifications for a beautiful world
Diffstat (limited to 'client/src/app/+admin/friends/friend-list/friend-list.component.ts')
-rw-r--r-- | client/src/app/+admin/friends/friend-list/friend-list.component.ts | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/client/src/app/+admin/friends/friend-list/friend-list.component.ts b/client/src/app/+admin/friends/friend-list/friend-list.component.ts index bec10162c..700ea7a69 100644 --- a/client/src/app/+admin/friends/friend-list/friend-list.component.ts +++ b/client/src/app/+admin/friends/friend-list/friend-list.component.ts | |||
@@ -1,5 +1,7 @@ | |||
1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
2 | 2 | ||
3 | import { NotificationsService } from 'angular2-notifications'; | ||
4 | |||
3 | import { Friend, FriendService } from '../shared'; | 5 | import { Friend, FriendService } from '../shared'; |
4 | 6 | ||
5 | @Component({ | 7 | @Component({ |
@@ -10,7 +12,10 @@ import { Friend, FriendService } from '../shared'; | |||
10 | export class FriendListComponent implements OnInit { | 12 | export class FriendListComponent implements OnInit { |
11 | friends: Friend[]; | 13 | friends: Friend[]; |
12 | 14 | ||
13 | constructor(private friendService: FriendService) { } | 15 | constructor( |
16 | private notificationsService: NotificationsService, | ||
17 | private friendService: FriendService | ||
18 | ) { } | ||
14 | 19 | ||
15 | ngOnInit() { | 20 | ngOnInit() { |
16 | this.getFriends(); | 21 | this.getFriends(); |
@@ -21,10 +26,12 @@ export class FriendListComponent implements OnInit { | |||
21 | 26 | ||
22 | this.friendService.quitFriends().subscribe( | 27 | this.friendService.quitFriends().subscribe( |
23 | status => { | 28 | status => { |
24 | alert('Quit friends!'); | 29 | this.notificationsService.success('Sucess', 'Friends left!'); |
30 | |||
25 | this.getFriends(); | 31 | this.getFriends(); |
26 | }, | 32 | }, |
27 | error => alert(error.text) | 33 | |
34 | err => this.notificationsService.error('Error', err.text) | ||
28 | ); | 35 | ); |
29 | } | 36 | } |
30 | 37 | ||
@@ -32,7 +39,7 @@ export class FriendListComponent implements OnInit { | |||
32 | this.friendService.getFriends().subscribe( | 39 | this.friendService.getFriends().subscribe( |
33 | res => this.friends = res.friends, | 40 | res => this.friends = res.friends, |
34 | 41 | ||
35 | err => alert(err.text) | 42 | err => this.notificationsService.error('Error', err.text) |
36 | ); | 43 | ); |
37 | } | 44 | } |
38 | } | 45 | } |