X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Ffollows%2Ffollowing-add%2Ffollowing-add.component.ts;h=c296c8852cbf15230952106dc3380c159cdbca51;hb=1f30a1853e38c20a45722dbd6d38aaaec63839e8;hp=bf842129d8b91c5aee8979ae56027a50e90f0bc3;hpb=78967fca4cacbc247fa6fb62d64b2d6825a10804;p=github%2FChocobozzz%2FPeerTube.git
diff --git a/client/src/app/+admin/follows/following-add/following-add.component.ts b/client/src/app/+admin/follows/following-add/following-add.component.ts
index bf842129d..c296c8852 100644
--- a/client/src/app/+admin/follows/following-add/following-add.component.ts
+++ b/client/src/app/+admin/follows/following-add/following-add.component.ts
@@ -43,7 +43,7 @@ export class FollowingAddComponent {
}
}
- addFollowing () {
+ async addFollowing () {
this.error = ''
const hosts = this.getNotEmptyHosts()
@@ -57,20 +57,17 @@ export class FollowingAddComponent {
}
const confirmMessage = 'If you confirm, you will send a follow request to:
- ' + hosts.join('
- ')
- this.confirmService.confirm(confirmMessage, 'Follow new server(s)').subscribe(
- res => {
- if (res === false) return
+ const res = await this.confirmService.confirm(confirmMessage, 'Follow new server(s)')
+ if (res === false) return
- this.followService.follow(hosts).subscribe(
- status => {
- this.notificationsService.success('Success', 'Follow request(s) sent!')
+ this.followService.follow(hosts).subscribe(
+ () => {
+ this.notificationsService.success('Success', 'Follow request(s) sent!')
- setTimeout(() => this.router.navigate([ '/admin/follows/following-list' ]), 500)
- },
+ setTimeout(() => this.router.navigate([ '/admin/follows/following-list' ]), 500)
+ },
- err => this.notificationsService.error('Error', err.message)
- )
- }
+ err => this.notificationsService.error('Error', err.message)
)
}