1
0
Fork 0

Don't display alt for actor images

We don't need it since it's just a "cosmetic" image
This commit is contained in:
Chocobozzz 2023-03-06 16:16:43 +01:00
parent b52f504848
commit 145d7da2de
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 1 additions and 10 deletions

View file

@ -1,5 +1,5 @@
<ng-template #img>
<img *ngIf="displayImage()" [class]="classes" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" />
<img *ngIf="displayImage()" [class]="classes" [src]="previewImage || avatarUrl || defaultAvatarUrl" alt="" />
<div *ngIf="displayActorInitial()" [ngClass]="classes">
<span>{{ getActorInitial() }}</span>

View file

@ -43,20 +43,17 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
}
classes: string[] = []
alt: string
defaultAvatarUrl: string
avatarUrl: string
ngOnInit () {
this.buildDefaultAvatarUrl()
this.buildAlt()
this.buildAvatarUrl()
this.buildClasses()
}
ngOnChanges () {
this.buildAlt()
this.buildAvatarUrl()
this.buildClasses()
}
@ -81,12 +78,6 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
}
}
private buildAlt () {
if (this.isAccount()) this.alt = $localize`Account avatar`
else if (this.isChannel()) this.alt = $localize`Channel avatar`
else this.alt = ''
}
private buildDefaultAvatarUrl () {
this.defaultAvatarUrl = this.isChannel()
? VideoChannel.GET_DEFAULT_AVATAR_URL(this.getSizeNumber())