aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/app/shared/shared-actor-image/actor-avatar.component.html2
-rw-r--r--client/src/app/shared/shared-actor-image/actor-avatar.component.ts6
2 files changed, 5 insertions, 3 deletions
diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.html b/client/src/app/shared/shared-actor-image/actor-avatar.component.html
index 13a5385a8..c285b6cc3 100644
--- a/client/src/app/shared/shared-actor-image/actor-avatar.component.html
+++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.html
@@ -1,7 +1,7 @@
1<ng-template #img> 1<ng-template #img>
2 <img *ngIf="previewImage || avatarUrl || !initial" [class]="getClass('avatar')" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" /> 2 <img *ngIf="previewImage || avatarUrl || !initial" [class]="getClass('avatar')" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" />
3 3
4 <div *ngIf="!avatarUrl && initial" [class]="getClass('initial')"> 4 <div *ngIf="!avatarUrl && initial" [ngClass]="getClass('initial')">
5 <span>{{ initial }}</span> 5 <span>{{ initial }}</span>
6 </div> 6 </div>
7</ng-template> 7</ng-template>
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 bc7e8a096..b2e1ef46e 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
@@ -89,9 +89,11 @@ export class ActorAvatarComponent {
89 } 89 }
90 90
91 private getColorTheme () { 91 private getColorTheme () {
92 const initialLowercase = this.initial.toLowerCase()
93
92 // Keep consistency with CSS 94 // Keep consistency with CSS
93 const themes = { 95 const themes = {
94 abc: 'blue', 96 '0123456789abc': 'blue',
95 def: 'green', 97 def: 'green',
96 ghi: 'purple', 98 ghi: 'purple',
97 jkl: 'gray', 99 jkl: 'gray',
@@ -102,7 +104,7 @@ export class ActorAvatarComponent {
102 } 104 }
103 105
104 const theme = Object.keys(themes) 106 const theme = Object.keys(themes)
105 .find(chars => chars.includes(this.initial)) 107 .find(chars => chars.includes(initialLowercase))
106 108
107 return themes[theme] 109 return themes[theme]
108 } 110 }