diff options
Diffstat (limited to 'client/src/app/videos/+video-watch/comment/video-comment.model.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comment.model.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.model.ts b/client/src/app/videos/+video-watch/comment/video-comment.model.ts index 3ed3ddcc7..719d1f04e 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.model.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment.model.ts | |||
@@ -12,6 +12,8 @@ export class VideoComment implements VideoCommentServerModel { | |||
12 | videoId: number | 12 | videoId: number |
13 | createdAt: Date | string | 13 | createdAt: Date | string |
14 | updatedAt: Date | string | 14 | updatedAt: Date | string |
15 | deletedAt: Date | string | ||
16 | isDeleted: boolean | ||
15 | account: AccountInterface | 17 | account: AccountInterface |
16 | totalReplies: number | 18 | totalReplies: number |
17 | by: string | 19 | by: string |
@@ -28,14 +30,18 @@ export class VideoComment implements VideoCommentServerModel { | |||
28 | this.videoId = hash.videoId | 30 | this.videoId = hash.videoId |
29 | this.createdAt = new Date(hash.createdAt.toString()) | 31 | this.createdAt = new Date(hash.createdAt.toString()) |
30 | this.updatedAt = new Date(hash.updatedAt.toString()) | 32 | this.updatedAt = new Date(hash.updatedAt.toString()) |
33 | this.deletedAt = hash.deletedAt ? new Date(hash.deletedAt.toString()) : null | ||
34 | this.isDeleted = hash.isDeleted | ||
31 | this.account = hash.account | 35 | this.account = hash.account |
32 | this.totalReplies = hash.totalReplies | 36 | this.totalReplies = hash.totalReplies |
33 | 37 | ||
34 | this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host) | 38 | if (this.account) { |
35 | this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) | 39 | this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host) |
40 | this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) | ||
36 | 41 | ||
37 | const absoluteAPIUrl = getAbsoluteAPIUrl() | 42 | const absoluteAPIUrl = getAbsoluteAPIUrl() |
38 | const thisHost = new URL(absoluteAPIUrl).host | 43 | const thisHost = new URL(absoluteAPIUrl).host |
39 | this.isLocal = this.account.host.trim() === thisHost | 44 | this.isLocal = this.account.host.trim() === thisHost |
45 | } | ||
40 | } | 46 | } |
41 | } | 47 | } |