Fix actor avatar background

This commit is contained in:
Chocobozzz 2021-04-29 09:10:57 +02:00
parent 931d343018
commit 8b5c8cd1e5
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<ng-template #img>
<img *ngIf="previewImage || avatarUrl || !initial" [class]="class" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" />
<img *ngIf="previewImage || avatarUrl || !initial" [class]="getClass('avatar')" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" />
<div *ngIf="!avatarUrl && initial" [class]="class">
<div *ngIf="!avatarUrl && initial" [class]="getClass('initial')">
<span>{{ initial }}</span>
</div>
</ng-template>

View File

@ -48,7 +48,7 @@ export class ActorAvatarComponent {
return ''
}
get class () {
getClass (type: 'avatar' | 'initial') {
const base = [ 'avatar' ]
if (this.size) base.push(`avatar-${this.size}`)
@ -56,7 +56,7 @@ export class ActorAvatarComponent {
if (this.account) base.push('account')
else base.push('channel')
if (this.initial) {
if (type === 'initial' && this.initial) {
base.push('initial')
base.push(this.getColorTheme())
}