Fix follow links
This commit is contained in:
parent
848347f193
commit
d15531fb35
|
@ -6,8 +6,8 @@
|
|||
|
||||
<div i18n class="no-results" *ngIf="followersPagination.totalItems === 0">{{ instanceName }} does not have followers.</div>
|
||||
|
||||
<a *ngFor="let follower of followers" [href]="buildLink(follower)" target="_blank" rel="noopener noreferrer">
|
||||
{{ follower }}
|
||||
<a *ngFor="let follower of followers" [href]="follower.url" target="_blank" rel="noopener noreferrer">
|
||||
{{ follower.name }}
|
||||
</a>
|
||||
|
||||
<button i18n class="peertube-button-link grey-button mt-1" *ngIf="!loadedAllFollowers && canLoadMoreFollowers()" (click)="loadAllFollowers()">Show full list</button>
|
||||
|
@ -18,8 +18,8 @@
|
|||
|
||||
<div i18n class="no-results" *ngIf="followingsPagination.totalItems === 0">{{ instanceName }} does not have subscriptions.</div>
|
||||
|
||||
<a *ngFor="let following of followings" [href]="buildLink(following)" target="_blank" rel="noopener noreferrer">
|
||||
{{ following }}
|
||||
<a *ngFor="let following of followings" [href]="following.url" target="_blank" rel="noopener noreferrer">
|
||||
{{ following.name }}
|
||||
</a>
|
||||
|
||||
<button i18n class="peertube-button-link grey-button mt-1" *ngIf="!loadedAllFollowings && canLoadMoreFollowings()" (click)="loadAllFollowings()">Show full list</button>
|
||||
|
|
|
@ -13,8 +13,8 @@ import { Actor } from '@shared/models/actors'
|
|||
export class AboutFollowsComponent implements OnInit {
|
||||
instanceName: string
|
||||
|
||||
followers: string[] = []
|
||||
followings: string[] = []
|
||||
followers: { name: string, url: string }[] = []
|
||||
followings: { name: string, url: string }[] = []
|
||||
|
||||
loadedAllFollowers = false
|
||||
loadedAllFollowings = false
|
||||
|
@ -130,10 +130,13 @@ export class AboutFollowsComponent implements OnInit {
|
|||
}
|
||||
|
||||
private formatFollow (actor: Actor) {
|
||||
// Instance follow, only display host
|
||||
if (actor.name === 'peertube') return actor.host
|
||||
return {
|
||||
// Instance follow, only display host
|
||||
name: actor.name === 'peertube'
|
||||
? actor.host
|
||||
: actor.name + '@' + actor.host,
|
||||
|
||||
return actor.name + '@' + actor.host
|
||||
url: actor.url
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue