]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/account/actor.model.ts
Add ability to report comments in front end
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / account / actor.model.ts
index 5fc7989dd6c833f8eaa0fc3091bf484fc976078e..9ec6dbab1bcb0d96771e86ec3f8eac019b9d8674 100644 (file)
@@ -14,7 +14,7 @@ export abstract class Actor implements ActorServer {
 
   avatarUrl: string
 
-  static GET_ACTOR_AVATAR_URL (actor: { avatar?: Avatar }) {
+  static GET_ACTOR_AVATAR_URL (actor: { avatar?: { url?: string, path: string } }) {
     if (actor?.avatar?.url) return actor.avatar.url
 
     if (actor && actor.avatar) {
@@ -46,8 +46,10 @@ export abstract class Actor implements ActorServer {
     this.host = hash.host
     this.followingCount = hash.followingCount
     this.followersCount = hash.followersCount
-    this.createdAt = new Date(hash.createdAt.toString())
-    this.updatedAt = new Date(hash.updatedAt.toString())
+
+    if (hash.createdAt) this.createdAt = new Date(hash.createdAt.toString())
+    if (hash.updatedAt) this.updatedAt = new Date(hash.updatedAt.toString())
+
     this.avatar = hash.avatar
 
     this.updateComputedAttributes()