From b537239c96323bf70762cbfc4d0faa255c050453 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Thu, 18 Feb 2021 16:09:25 +0100 Subject: [PATCH] AW-1881 Avatar based on first letters of firstname and lastname --- .../src/fm/components/user-menu/user-menu.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/common/src/fm/components/user-menu/user-menu.component.ts b/projects/common/src/fm/components/user-menu/user-menu.component.ts index 7e279d5..2e9adb5 100644 --- a/projects/common/src/fm/components/user-menu/user-menu.component.ts +++ b/projects/common/src/fm/components/user-menu/user-menu.component.ts @@ -21,7 +21,10 @@ export class UserMenuComponent implements OnInit { } getLetter():string { - return this.user && this.user.name ? this.user.name.substr(0,1).toUpperCase():""; + if (this.user && this.user.firstName && this.user.lastName) + return this.user.firstName.substr(0,1).toUpperCase() + + this.user.lastName.substr(0,1).toUpperCase(); + return this.user && this.user.name ? this.user.name.substr(0,1).toUpperCase():""; } logout(event:MouseEvent) {