]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/account/account.model.ts
Add avatar in comments
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / account / account.model.ts
CommitLineData
50d6de9c 1import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model'
b1fa3eba 2import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
63c4db6d 3import { environment } from '../../../environments/environment'
c5911fd3 4import { getAbsoluteAPIUrl } from '../misc/utils'
b1fa3eba
C
5
6export class Account implements ServerAccount {
7 id: number
8 uuid: string
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}