X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2F%2Bvideo-watch%2Fcomment%2Fvideo-comment.component.ts;h=61f9335d194cba0a1c01e4dad84f04809ce43bef;hb=c511c3f010c45e08e7736a935bf721527db806c8;hp=0d48f0a8205d2bac46482666c42824f82d3b8ac1;hpb=51e028a94e79957a4ef6a620b9ef3c956064f05e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts index 0d48f0a82..61f9335d1 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts @@ -9,6 +9,7 @@ import { MarkdownService } from '@app/shared/renderer' import { Account } from '@app/shared/account/account.model' import { Notifier } from '@app/core' import { UserService } from '@app/shared' +import { Actor } from '@app/shared/actor/actor.model' @Component({ selector: 'my-video-comment', @@ -22,6 +23,7 @@ export class VideoCommentComponent implements OnInit, OnChanges { @Input() commentTree: VideoCommentThreadTree @Input() inReplyToCommentId: number @Input() highlightedComment = false + @Input() firstInThread = false @Output() wantedToDelete = new EventEmitter() @Output() wantedToReply = new EventEmitter() @@ -100,13 +102,17 @@ export class VideoCommentComponent implements OnInit, OnChanges { ) } + switchToDefaultAvatar ($event: Event) { + ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL() + } + private getUserIfNeeded (account: Account) { if (!account.userId) return if (!this.authService.isLoggedIn()) return const user = this.authService.getUser() if (user.hasRight(UserRight.MANAGE_USERS)) { - this.userService.getUser(account.userId) + this.userService.getUserWithCache(account.userId) .subscribe( user => this.commentUser = user,