aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-29 19:10:13 +0100
committerChocobozzz <me@florianbigard.com>2017-12-29 19:10:13 +0100
commitc5911fd347c76e8bdc05ea9f3ee9efed4a58c236 (patch)
treeb8d287daca6c45305090cbec9da97d1155f275bd /client/src/app/shared/account
parent8b0d42ee372de6589796be26b83e5bffb1b69cdf (diff)
downloadPeerTube-c5911fd347c76e8bdc05ea9f3ee9efed4a58c236.tar.gz
PeerTube-c5911fd347c76e8bdc05ea9f3ee9efed4a58c236.tar.zst
PeerTube-c5911fd347c76e8bdc05ea9f3ee9efed4a58c236.zip
Begin to add avatar to actors
Diffstat (limited to 'client/src/app/shared/account')
-rw-r--r--client/src/app/shared/account/account.model.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/client/src/app/shared/account/account.model.ts b/client/src/app/shared/account/account.model.ts
index bacaa208a..cc46dad77 100644
--- a/client/src/app/shared/account/account.model.ts
+++ b/client/src/app/shared/account/account.model.ts
@@ -1,11 +1,13 @@
1import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model' 1import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model'
2import { Avatar } from '../../../../../shared/models/avatars/avatar.model' 2import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
3import { environment } from '../../../environments/environment' 3import { environment } from '../../../environments/environment'
4import { getAbsoluteAPIUrl } from '../misc/utils'
4 5
5export class Account implements ServerAccount { 6export class Account implements ServerAccount {
6 id: number 7 id: number
7 uuid: string 8 uuid: string
8 name: string 9 name: string
10 displayName: string
9 host: string 11 host: string
10 followingCount: number 12 followingCount: number
11 followersCount: number 13 followersCount: number
@@ -13,9 +15,11 @@ export class Account implements ServerAccount {
13 updatedAt: Date 15 updatedAt: Date
14 avatar: Avatar 16 avatar: Avatar
15 17
16 static GET_ACCOUNT_AVATAR_PATH (account: Account) { 18 static GET_ACCOUNT_AVATAR_URL (account: Account) {
17 if (account && account.avatar) return account.avatar.path 19 const absoluteAPIUrl = getAbsoluteAPIUrl()
18 20
19 return '/client/assets/images/default-avatar.png' 21 if (account && account.avatar) return absoluteAPIUrl + account.avatar.path
22
23 return window.location.origin + '/client/assets/images/default-avatar.png'
20 } 24 }
21} 25}