1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

[SM-590] show email as fallback name in SM header (#4957)

* show email if name is falsy

* update and use user-name pipe
This commit is contained in:
Will Martin
2023-03-10 09:53:15 -05:00
committed by GitHub
parent e57bc7f781
commit 363fc7e022
2 changed files with 8 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ import { Pipe, PipeTransform } from "@angular/core";
interface User {
name?: string;
email: string;
email?: string;
}
@Pipe({
@@ -14,6 +14,10 @@ export class UserNamePipe implements PipeTransform {
return null;
}
if (user.name == null && user.email == null) {
return null;
}
return user.name == null || user.name.trim() === "" ? user.email : user.name;
}
}