use "undefined" as undefined in name pipe

This commit is contained in:
Dan Percic 2022-08-19 16:49:40 +03:00
parent 61ae1e8bac
commit 4c0e6d1bed

View File

@ -29,13 +29,11 @@ export class NamePipe implements PipeTransform {
constructor(private readonly _userService: IqserUserService, private readonly _translateService: TranslateService) {}
transform(value: IqserUser | string, options: NamePipeOptions = this._defaultOptions): string {
let name: string | undefined;
if (!value) {
if (!value || value === 'undefined') {
return this._getDefaultName(options);
}
name = value ? this._userService.getName(value) : options.defaultValue;
let name = value ? this._userService.getName(value) : options.defaultValue;
if (!name) {
return this._getDefaultName(options);