]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-actor-image/actor-avatar.component.ts
Refactor my actor avatar edit
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-actor-image / actor-avatar.component.ts
index 6036123f93fd8b131fdceccd742a2892da727948..a52e68a176614f856e4823f89bf0b83194512df5 100644 (file)
@@ -50,15 +50,15 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
   ngOnInit () {
     this.buildDefaultAvatarUrl()
 
-    this.buildClasses()
     this.buildAlt()
     this.buildAvatarUrl()
+    this.buildClasses()
   }
 
   ngOnChanges () {
-    this.buildClasses()
     this.buildAlt()
     this.buildAvatarUrl()
+    this.buildClasses()
   }
 
   private buildClasses () {
@@ -114,12 +114,13 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
 
   displayImage () {
     if (this.actorType === 'unlogged') return true
+    if (this.previewImage) return true
 
     return !!(this.actor && this.avatarUrl)
   }
 
   displayActorInitial () {
-    return this.actor && !this.avatarUrl
+    return !this.displayImage() && this.actor && !this.avatarUrl
   }
 
   displayPlaceholder () {