aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users/user.model.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-12-04 10:34:40 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-12-04 10:34:40 +0100
commit2295ce6c4e7ba805cc100ff961527bebc2cd89e5 (patch)
treefce0a24074ac119aad730ef5c73c680500ff9578 /client/src/app/shared/users/user.model.ts
parent202f6b6c9dcc9b0aec4b0c1b15e455c22a7952a7 (diff)
downloadPeerTube-2295ce6c4e7ba805cc100ff961527bebc2cd89e5.tar.gz
PeerTube-2295ce6c4e7ba805cc100ff961527bebc2cd89e5.tar.zst
PeerTube-2295ce6c4e7ba805cc100ff961527bebc2cd89e5.zip
Add account avatar
Diffstat (limited to 'client/src/app/shared/users/user.model.ts')
-rw-r--r--client/src/app/shared/users/user.model.ts25
1 files changed, 10 insertions, 15 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
index b075ab717..83990d8b8 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/shared/users/user.model.ts
@@ -1,10 +1,5 @@
1import { 1import { hasUserRight, User as UserServerModel, UserRight, UserRole, VideoChannel } from '../../../../../shared'
2 User as UserServerModel, 2import { Account } from '../../../../../shared/models/accounts'
3 UserRole,
4 VideoChannel,
5 UserRight,
6 hasUserRight
7} from '../../../../../shared'
8 3
9export type UserConstructorHash = { 4export type UserConstructorHash = {
10 id: number, 5 id: number,
@@ -14,10 +9,7 @@ export type UserConstructorHash = {
14 videoQuota?: number, 9 videoQuota?: number,
15 displayNSFW?: boolean, 10 displayNSFW?: boolean,
16 createdAt?: Date, 11 createdAt?: Date,
17 account?: { 12 account?: Account,
18 id: number
19 uuid: string
20 },
21 videoChannels?: VideoChannel[] 13 videoChannels?: VideoChannel[]
22} 14}
23export class User implements UserServerModel { 15export class User implements UserServerModel {
@@ -27,10 +19,7 @@ export class User implements UserServerModel {
27 role: UserRole 19 role: UserRole
28 displayNSFW: boolean 20 displayNSFW: boolean
29 videoQuota: number 21 videoQuota: number
30 account: { 22 account: Account
31 id: number
32 uuid: string
33 }
34 videoChannels: VideoChannel[] 23 videoChannels: VideoChannel[]
35 createdAt: Date 24 createdAt: Date
36 25
@@ -61,4 +50,10 @@ export class User implements UserServerModel {
61 hasRight (right: UserRight) { 50 hasRight (right: UserRight) {
62 return hasUserRight(this.role, right) 51 return hasUserRight(this.role, right)
63 } 52 }
53
54 getAvatarPath () {
55 if (this.account && this.account.avatar) return this.account.avatar.path
56
57 return '/assets/default-avatar.png'
58 }
64} 59}