aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+about/about-follows/about-follows.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+about/about-follows/about-follows.component.ts')
-rw-r--r--client/src/app/+about/about-follows/about-follows.component.ts19
1 files changed, 16 insertions, 3 deletions
diff --git a/client/src/app/+about/about-follows/about-follows.component.ts b/client/src/app/+about/about-follows/about-follows.component.ts
index 84b47e967..35d810388 100644
--- a/client/src/app/+about/about-follows/about-follows.component.ts
+++ b/client/src/app/+about/about-follows/about-follows.component.ts
@@ -1,7 +1,8 @@
1import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
2import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
3import { ComponentPagination, hasMoreItems, Notifier, RestService } from '@app/core' 3import { ComponentPagination, hasMoreItems, Notifier, RestService, ServerService } from '@app/core'
4import { InstanceFollowService } from '@app/shared/shared-instance' 4import { InstanceFollowService } from '@app/shared/shared-instance'
5import { Actor } from '@shared/models/actors'
5 6
6@Component({ 7@Component({
7 selector: 'my-about-follows', 8 selector: 'my-about-follows',
@@ -10,6 +11,8 @@ import { InstanceFollowService } from '@app/shared/shared-instance'
10}) 11})
11 12
12export class AboutFollowsComponent implements OnInit { 13export class AboutFollowsComponent implements OnInit {
14 instanceName: string
15
13 followers: string[] = [] 16 followers: string[] = []
14 followings: string[] = [] 17 followings: string[] = []
15 18
@@ -34,6 +37,7 @@ export class AboutFollowsComponent implements OnInit {
34 } 37 }
35 38
36 constructor ( 39 constructor (
40 private server: ServerService,
37 private restService: RestService, 41 private restService: RestService,
38 private notifier: Notifier, 42 private notifier: Notifier,
39 private followService: InstanceFollowService 43 private followService: InstanceFollowService
@@ -43,6 +47,8 @@ export class AboutFollowsComponent implements OnInit {
43 this.loadMoreFollowers() 47 this.loadMoreFollowers()
44 48
45 this.loadMoreFollowings() 49 this.loadMoreFollowings()
50
51 this.instanceName = this.server.getHTMLConfig().instance.name
46 } 52 }
47 53
48 loadAllFollowings () { 54 loadAllFollowings () {
@@ -95,7 +101,7 @@ export class AboutFollowsComponent implements OnInit {
95 next: resultList => { 101 next: resultList => {
96 if (reset) this.followers = [] 102 if (reset) this.followers = []
97 103
98 const newFollowers = resultList.data.map(r => r.follower.host) 104 const newFollowers = resultList.data.map(r => this.formatFollow(r.follower))
99 this.followers = this.followers.concat(newFollowers) 105 this.followers = this.followers.concat(newFollowers)
100 106
101 this.followersPagination.totalItems = resultList.total 107 this.followersPagination.totalItems = resultList.total
@@ -113,7 +119,7 @@ export class AboutFollowsComponent implements OnInit {
113 next: resultList => { 119 next: resultList => {
114 if (reset) this.followings = [] 120 if (reset) this.followings = []
115 121
116 const newFollowings = resultList.data.map(r => r.following.host) 122 const newFollowings = resultList.data.map(r => this.formatFollow(r.following))
117 this.followings = this.followings.concat(newFollowings) 123 this.followings = this.followings.concat(newFollowings)
118 124
119 this.followingsPagination.totalItems = resultList.total 125 this.followingsPagination.totalItems = resultList.total
@@ -123,4 +129,11 @@ export class AboutFollowsComponent implements OnInit {
123 }) 129 })
124 } 130 }
125 131
132 private formatFollow (actor: Actor) {
133 // Instance follow, only display host
134 if (actor.name === 'peertube') return actor.host
135
136 return actor.name + '@' + actor.host
137 }
138
126} 139}