aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-actor-image/actor-avatar.component.ts')
-rw-r--r--client/src/app/shared/shared-actor-image/actor-avatar.component.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
index c323dc724..bc7e8a096 100644
--- a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
+++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
@@ -4,11 +4,11 @@ import { Account } from '../shared-main/account/account.model'
4 4
5type ActorInput = { 5type ActorInput = {
6 name: string 6 name: string
7 avatar?: { url?: string, path: string } 7 avatars: { width: number, url?: string, path: string }[]
8 url: string 8 url: string
9} 9}
10 10
11export type ActorAvatarSize = '18' | '25' | '32' | '34' | '36' | '40' | '100' | '120' 11export type ActorAvatarSize = '18' | '25' | '28' | '32' | '34' | '35' | '36' | '40' | '48' | '75' | '80' | '100' | '120'
12 12
13@Component({ 13@Component({
14 selector: 'my-actor-avatar', 14 selector: 'my-actor-avatar',
@@ -23,7 +23,7 @@ export class ActorAvatarComponent {
23 23
24 @Input() previewImage: string 24 @Input() previewImage: string
25 25
26 @Input() size: ActorAvatarSize 26 @Input() size: ActorAvatarSize = '32'
27 27
28 // Use an external link 28 // Use an external link
29 @Input() href: string 29 @Input() href: string
@@ -50,14 +50,13 @@ export class ActorAvatarComponent {
50 } 50 }
51 51
52 get defaultAvatarUrl () { 52 get defaultAvatarUrl () {
53 if (this.channel) return VideoChannel.GET_DEFAULT_AVATAR_URL() 53 if (this.account) return Account.GET_DEFAULT_AVATAR_URL(+this.size)
54 54 if (this.channel) return VideoChannel.GET_DEFAULT_AVATAR_URL(+this.size)
55 return Account.GET_DEFAULT_AVATAR_URL()
56 } 55 }
57 56
58 get avatarUrl () { 57 get avatarUrl () {
59 if (this.account) return Account.GET_ACTOR_AVATAR_URL(this.account) 58 if (this.account) return Account.GET_ACTOR_AVATAR_URL(this.account, +this.size)
60 if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.channel) 59 if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.channel, +this.size)
61 60
62 return '' 61 return ''
63 } 62 }