aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-actor-image
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-03-06 11:39:23 +0100
committerChocobozzz <me@florianbigard.com>2023-03-07 10:18:32 +0100
commit9e401fde36bdcb4b5e8dc54262c01f1e660d81a8 (patch)
treea2a3c115254370048c6dc0178c7ac91b977a3f2d /client/src/app/shared/shared-actor-image
parent464e4ed92c119c8f5d8ae561ad1d27a90d2581a0 (diff)
downloadPeerTube-9e401fde36bdcb4b5e8dc54262c01f1e660d81a8.tar.gz
PeerTube-9e401fde36bdcb4b5e8dc54262c01f1e660d81a8.tar.zst
PeerTube-9e401fde36bdcb4b5e8dc54262c01f1e660d81a8.zip
Refactor my actor avatar edit
Diffstat (limited to 'client/src/app/shared/shared-actor-image')
-rw-r--r--client/src/app/shared/shared-actor-image/actor-avatar.component.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
index 6036123f9..a52e68a17 100644
--- a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
+++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
@@ -50,15 +50,15 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
50 ngOnInit () { 50 ngOnInit () {
51 this.buildDefaultAvatarUrl() 51 this.buildDefaultAvatarUrl()
52 52
53 this.buildClasses()
54 this.buildAlt() 53 this.buildAlt()
55 this.buildAvatarUrl() 54 this.buildAvatarUrl()
55 this.buildClasses()
56 } 56 }
57 57
58 ngOnChanges () { 58 ngOnChanges () {
59 this.buildClasses()
60 this.buildAlt() 59 this.buildAlt()
61 this.buildAvatarUrl() 60 this.buildAvatarUrl()
61 this.buildClasses()
62 } 62 }
63 63
64 private buildClasses () { 64 private buildClasses () {
@@ -114,12 +114,13 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
114 114
115 displayImage () { 115 displayImage () {
116 if (this.actorType === 'unlogged') return true 116 if (this.actorType === 'unlogged') return true
117 if (this.previewImage) return true
117 118
118 return !!(this.actor && this.avatarUrl) 119 return !!(this.actor && this.avatarUrl)
119 } 120 }
120 121
121 displayActorInitial () { 122 displayActorInitial () {
122 return this.actor && !this.avatarUrl 123 return !this.displayImage() && this.actor && !this.avatarUrl
123 } 124 }
124 125
125 displayPlaceholder () { 126 displayPlaceholder () {