From c511c3f010c45e08e7736a935bf721527db806c8 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 7 Jan 2020 15:42:14 +0100 Subject: Show default avatar on network error for comments --- .../src/app/videos/+video-watch/comment/video-comment.component.html | 1 + .../src/app/videos/+video-watch/comment/video-comment.component.ts | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'client/src/app/videos') diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.html b/client/src/app/videos/+video-watch/comment/video-comment.component.html index 246a08435..617d0fa41 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.component.html +++ b/client/src/app/videos/+video-watch/comment/video-comment.component.html @@ -4,6 +4,7 @@ Avatar 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 0c18b6e5d..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', @@ -101,6 +102,10 @@ 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 -- cgit v1.2.3