diff options
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 | 38 |
1 files changed, 19 insertions, 19 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 525a9fbc3..7bf9d2c6b 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,11 +1,11 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core' |
2 | 2 | ||
3 | import { NotificationsService } from 'angular2-notifications'; | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | import { ServerDataSource } from 'ng2-smart-table'; | 4 | import { ServerDataSource } from 'ng2-smart-table' |
5 | 5 | ||
6 | import { ConfirmService } from '../../../core'; | 6 | import { ConfirmService } from '../../../core' |
7 | import { Utils } from '../../../shared'; | 7 | import { Utils } from '../../../shared' |
8 | import { Friend, FriendService } from '../shared'; | 8 | import { Friend, FriendService } from '../shared' |
9 | 9 | ||
10 | @Component({ | 10 | @Component({ |
11 | selector: 'my-friend-list', | 11 | selector: 'my-friend-list', |
@@ -13,7 +13,7 @@ import { Friend, FriendService } from '../shared'; | |||
13 | styleUrls: [ './friend-list.component.scss' ] | 13 | styleUrls: [ './friend-list.component.scss' ] |
14 | }) | 14 | }) |
15 | export class FriendListComponent { | 15 | export class FriendListComponent { |
16 | friendsSource = null; | 16 | friendsSource = null |
17 | tableSettings = { | 17 | tableSettings = { |
18 | attr: { | 18 | attr: { |
19 | class: 'table-hover' | 19 | class: 'table-hover' |
@@ -49,36 +49,36 @@ export class FriendListComponent { | |||
49 | valuePrepareFunction: Utils.dateToHuman | 49 | valuePrepareFunction: Utils.dateToHuman |
50 | } | 50 | } |
51 | } | 51 | } |
52 | }; | 52 | } |
53 | 53 | ||
54 | constructor( | 54 | constructor ( |
55 | private notificationsService: NotificationsService, | 55 | private notificationsService: NotificationsService, |
56 | private confirmService: ConfirmService, | 56 | private confirmService: ConfirmService, |
57 | private friendService: FriendService | 57 | private friendService: FriendService |
58 | ) { | 58 | ) { |
59 | this.friendsSource = this.friendService.getDataSource(); | 59 | this.friendsSource = this.friendService.getDataSource() |
60 | } | 60 | } |
61 | 61 | ||
62 | hasFriends() { | 62 | hasFriends () { |
63 | return this.friendsSource.count() !== 0; | 63 | return this.friendsSource.count() !== 0 |
64 | } | 64 | } |
65 | 65 | ||
66 | quitFriends() { | 66 | quitFriends () { |
67 | const confirmMessage = 'Do you really want to quit your friends? All their videos will be deleted.'; | 67 | const confirmMessage = 'Do you really want to quit your friends? All their videos will be deleted.' |
68 | this.confirmService.confirm(confirmMessage, 'Quit friends').subscribe( | 68 | this.confirmService.confirm(confirmMessage, 'Quit friends').subscribe( |
69 | res => { | 69 | res => { |
70 | if (res === false) return; | 70 | if (res === false) return |
71 | 71 | ||
72 | this.friendService.quitFriends().subscribe( | 72 | this.friendService.quitFriends().subscribe( |
73 | status => { | 73 | status => { |
74 | this.notificationsService.success('Sucess', 'Friends left!'); | 74 | this.notificationsService.success('Sucess', 'Friends left!') |
75 | 75 | ||
76 | this.friendsSource.refresh(); | 76 | this.friendsSource.refresh() |
77 | }, | 77 | }, |
78 | 78 | ||
79 | err => this.notificationsService.error('Error', err.text) | 79 | err => this.notificationsService.error('Error', err.text) |
80 | ); | 80 | ) |
81 | } | 81 | } |
82 | ); | 82 | ) |
83 | } | 83 | } |
84 | } | 84 | } |