diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-01-07 15:42:14 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-01-09 09:25:32 +0100 |
commit | c511c3f010c45e08e7736a935bf721527db806c8 (patch) | |
tree | 5abc1ddd09b4d5b9b779f6d057fbda58015eab68 /client/src/app/videos/+video-watch/comment/video-comment.component.ts | |
parent | fbc77eb648bda9add4634c08dbb6af48c3670b5d (diff) | |
download | PeerTube-c511c3f010c45e08e7736a935bf721527db806c8.tar.gz PeerTube-c511c3f010c45e08e7736a935bf721527db806c8.tar.zst PeerTube-c511c3f010c45e08e7736a935bf721527db806c8.zip |
Show default avatar on network error for comments
Diffstat (limited to 'client/src/app/videos/+video-watch/comment/video-comment.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comment.component.ts | 5 |
1 files changed, 5 insertions, 0 deletions
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 |