From: Chocobozzz Date: Tue, 23 Aug 2016 15:47:58 +0000 (+0200) Subject: Client: refresh friends list after quitting them X-Git-Tag: v0.0.1-alpha~757 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=93c462b77170669df40c60db68db112198082ab9;hp=039cdfc528a26ddb19b0b3bcdf09f825723b37b5;p=github%2FChocobozzz%2FPeerTube.git Client: refresh friends list after quitting them --- 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 379d44c97..38d4799a6 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 @@ -15,11 +15,7 @@ export class FriendListComponent implements OnInit { constructor(private friendService: FriendService) { } ngOnInit() { - this.friendService.getFriends().subscribe( - friends => this.friends = friends, - - err => alert(err) - ); + this.getFriends(); } quitFriends() { @@ -28,8 +24,17 @@ export class FriendListComponent implements OnInit { this.friendService.quitFriends().subscribe( status => { alert('Quit friends!'); + this.getFriends(); }, error => alert(error) ); } + + private getFriends() { + this.friendService.getFriends().subscribe( + friends => this.friends = friends, + + err => alert(err) + ); + } }