aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/+about/about-follows/about-follows.component.html22
-rw-r--r--client/src/app/+about/about-follows/about-follows.component.ts10
2 files changed, 25 insertions, 7 deletions
diff --git a/client/src/app/+about/about-follows/about-follows.component.html b/client/src/app/+about/about-follows/about-follows.component.html
index 50e00b651..a05c40184 100644
--- a/client/src/app/+about/about-follows/about-follows.component.html
+++ b/client/src/app/+about/about-follows/about-follows.component.html
@@ -6,10 +6,16 @@
6 <div i18n class="no-results" *ngIf="followersPagination.totalItems === 0">This instance does not have instances followers.</div> 6 <div i18n class="no-results" *ngIf="followersPagination.totalItems === 0">This instance does not have instances followers.</div>
7 7
8 <a *ngFor="let follower of followers" [href]="buildLink(follower)" target="_blank" rel="noopener noreferrer"> 8 <a *ngFor="let follower of followers" [href]="buildLink(follower)" target="_blank" rel="noopener noreferrer">
9 {{ follower }} 9 {{follower}}
10 </a> 10 </a>
11 11 <ng-container *ngIf="showMoreFollowers">
12 <a i18n class="showMore" *ngIf="!showMoreFollowers" (click)="loadAllFollowers()" (click)= "showMoreFollowers=true">Show full list</a> 12 <a *ngFor="let follower of moreFollowers" [href]="buildLink(follower)" target="_blank" rel="noopener noreferrer">
13 {{ follower }}
14 </a>
15 </ng-container>
16
17 <a i18n class="showMore" *ngIf="!showMoreFollowers" (click)="loadAllFollowers()" (click)="showMoreFollowers=true">Show full list</a>
18 <a i18n class="showMore" *ngIf="showMoreFollowers" (click)= "showMoreFollowers=false">Show less</a>
13 </div> 19 </div>
14 20
15 <div class="col-xl-6 col-md-12"> 21 <div class="col-xl-6 col-md-12">
@@ -28,8 +34,14 @@
28 <a *ngFor="let following of followings" [href]="buildLink(following)" target="_blank" rel="noopener noreferrer"> 34 <a *ngFor="let following of followings" [href]="buildLink(following)" target="_blank" rel="noopener noreferrer">
29 {{ following }} 35 {{ following }}
30 </a> 36 </a>
31 37 <ng-container *ngIf="showMoreFollowings">
32 <a i18n class="showMore" *ngIf="!showMoreFollowings" (click)="loadAllFollowings()" (click)= "showMoreFollowings=true">Show full list</a> 38 <a *ngFor="let following of moreFollowings" [href]="buildLink(following)" target="_blank" rel="noopener noreferrer">
39 {{ following }}
40 </a>
41 </ng-container>
42
43 <a i18n class="showMore" *ngIf="!showMoreFollowings" (click)="loadAllFollowings()" (click)="showMoreFollowings=true">Show full list</a>
44 <a i18n class="showMore" *ngIf="showMoreFollowings" (click)="showMoreFollowings=false">Show less</a>
33 </div> 45 </div>
34 46
35</div> 47</div>
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 e5526248c..00bd48c9c 100644
--- a/client/src/app/+about/about-follows/about-follows.component.ts
+++ b/client/src/app/+about/about-follows/about-follows.component.ts
@@ -13,6 +13,8 @@ import { InstanceFollowService } from '@app/shared/shared-instance'
13export class AboutFollowsComponent implements OnInit { 13export class AboutFollowsComponent implements OnInit {
14 followers: string[] = [] 14 followers: string[] = []
15 followings: string[] = [] 15 followings: string[] = []
16 moreFollowers: string[] = []
17 moreFollowings: string[] = []
16 18
17 showMoreFollowers = false 19 showMoreFollowers = false
18 showMoreFollowings = false 20 showMoreFollowings = false
@@ -75,7 +77,9 @@ export class AboutFollowsComponent implements OnInit {
75 .subscribe( 77 .subscribe(
76 resultList => { 78 resultList => {
77 const newFollowers = resultList.data.map(r => r.follower.host) 79 const newFollowers = resultList.data.map(r => r.follower.host)
78 this.followers = this.followers.concat(newFollowers) 80 if (this.followers.length === 0) this.followers = this.followers.concat(newFollowers)
81
82 else this.moreFollowers = this.moreFollowers.concat(newFollowers)
79 83
80 this.followersPagination.totalItems = resultList.total 84 this.followersPagination.totalItems = resultList.total
81 85
@@ -93,7 +97,9 @@ export class AboutFollowsComponent implements OnInit {
93 .subscribe( 97 .subscribe(
94 resultList => { 98 resultList => {
95 const newFollowings = resultList.data.map(r => r.following.host) 99 const newFollowings = resultList.data.map(r => r.following.host)
96 this.followings = this.followings.concat(newFollowings) 100 if (this.followings.length===0) this.followings = this.followings.concat(newFollowings)
101
102 else this.moreFollowings = this.moreFollowings.concat(newFollowings)
97 103
98 this.followingsPagination.totalItems = resultList.total 104 this.followingsPagination.totalItems = resultList.total
99 105