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-add | |
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-add')
-rw-r--r-- | client/src/app/+admin/friends/friend-add/friend-add.component.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/+admin/friends/friend-add/friend-add.component.ts b/client/src/app/+admin/friends/friend-add/friend-add.component.ts index 014252011..a271970ae 100644 --- a/client/src/app/+admin/friends/friend-add/friend-add.component.ts +++ b/client/src/app/+admin/friends/friend-add/friend-add.component.ts | |||
@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core'; | |||
2 | import { FormControl, FormGroup } from '@angular/forms'; | 2 | import { FormControl, FormGroup } from '@angular/forms'; |
3 | import { Router } from '@angular/router'; | 3 | import { Router } from '@angular/router'; |
4 | 4 | ||
5 | import { NotificationsService } from 'angular2-notifications'; | ||
6 | |||
5 | import { validateHost } from '../../../shared'; | 7 | import { validateHost } from '../../../shared'; |
6 | import { FriendService } from '../shared'; | 8 | import { FriendService } from '../shared'; |
7 | 9 | ||
@@ -15,7 +17,11 @@ export class FriendAddComponent implements OnInit { | |||
15 | hosts = [ ]; | 17 | hosts = [ ]; |
16 | error: string = null; | 18 | error: string = null; |
17 | 19 | ||
18 | constructor(private router: Router, private friendService: FriendService) {} | 20 | constructor( |
21 | private router: Router, | ||
22 | private notificationsService: NotificationsService, | ||
23 | private friendService: FriendService | ||
24 | ) {} | ||
19 | 25 | ||
20 | ngOnInit() { | 26 | ngOnInit() { |
21 | this.form = new FormGroup({}); | 27 | this.form = new FormGroup({}); |
@@ -83,10 +89,11 @@ export class FriendAddComponent implements OnInit { | |||
83 | 89 | ||
84 | this.friendService.makeFriends(notEmptyHosts).subscribe( | 90 | this.friendService.makeFriends(notEmptyHosts).subscribe( |
85 | status => { | 91 | status => { |
86 | alert('Make friends request sent!'); | 92 | this.notificationsService.success('Sucess', 'Make friends request sent!'); |
87 | this.router.navigate([ '/admin/friends/list' ]); | 93 | this.router.navigate([ '/admin/friends/list' ]); |
88 | }, | 94 | }, |
89 | error => alert(error.text) | 95 | |
96 | err => this.notificationsService.error('Error', err.text) | ||
90 | ); | 97 | ); |
91 | } | 98 | } |
92 | 99 | ||