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