diff options
Diffstat (limited to 'client/src/app/videos/+video-watch')
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comment.component.html | 1 | ||||
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comment.component.ts | 5 |
2 files changed, 6 insertions, 0 deletions
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 @@ | |||
4 | <img | 4 | <img |
5 | class="comment-avatar" | 5 | class="comment-avatar" |
6 | [src]="comment.accountAvatarUrl" | 6 | [src]="comment.accountAvatarUrl" |
7 | (error)="switchToDefaultAvatar($event)" | ||
7 | alt="Avatar" | 8 | alt="Avatar" |
8 | /> | 9 | /> |
9 | </a> | 10 | </a> |
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' | |||
9 | import { Account } from '@app/shared/account/account.model' | 9 | import { Account } from '@app/shared/account/account.model' |
10 | import { Notifier } from '@app/core' | 10 | import { Notifier } from '@app/core' |
11 | import { UserService } from '@app/shared' | 11 | import { UserService } from '@app/shared' |
12 | import { Actor } from '@app/shared/actor/actor.model' | ||
12 | 13 | ||
13 | @Component({ | 14 | @Component({ |
14 | selector: 'my-video-comment', | 15 | selector: 'my-video-comment', |
@@ -101,6 +102,10 @@ export class VideoCommentComponent implements OnInit, OnChanges { | |||
101 | ) | 102 | ) |
102 | } | 103 | } |
103 | 104 | ||
105 | switchToDefaultAvatar ($event: Event) { | ||
106 | ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL() | ||
107 | } | ||
108 | |||
104 | private getUserIfNeeded (account: Account) { | 109 | private getUserIfNeeded (account: Account) { |
105 | if (!account.userId) return | 110 | if (!account.userId) return |
106 | if (!this.authService.isLoggedIn()) return | 111 | if (!this.authService.isLoggedIn()) return |