]>
Commit | Line | Data |
---|---|---|
50d6de9c | 1 | import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model' |
b1fa3eba | 2 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' |
c5911fd3 | 3 | import { getAbsoluteAPIUrl } from '../misc/utils' |
b1fa3eba C |
4 | |
5 | export class Account implements ServerAccount { | |
6 | id: number | |
7 | uuid: string | |
4cb6d457 | 8 | url: string |
b1fa3eba | 9 | name: string |
c5911fd3 | 10 | displayName: string |
b1fa3eba C |
11 | host: string |
12 | followingCount: number | |
13 | followersCount: number | |
14 | createdAt: Date | |
15 | updatedAt: Date | |
16 | avatar: Avatar | |
17 | ||
c5911fd3 C |
18 | static GET_ACCOUNT_AVATAR_URL (account: Account) { |
19 | const absoluteAPIUrl = getAbsoluteAPIUrl() | |
b1fa3eba | 20 | |
c5911fd3 C |
21 | if (account && account.avatar) return absoluteAPIUrl + account.avatar.path |
22 | ||
23 | return window.location.origin + '/client/assets/images/default-avatar.png' | |
b1fa3eba C |
24 | } |
25 | } |