Commit b4357098 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #20573 TIME 0:15 contact first/last name: check emptiness

parent 97cdca95
......@@ -647,8 +647,12 @@ export class MailEditorComponent implements OnInit, OnDestroy {
data = data.filter((contact: any) => !this.functions.empty(contact.email) || contact.type === 'contactGroup').map((contact: any) => {
let label: string;
if (contact.type === 'user' || contact.type === 'contact') {
if (!this.functions.empty(contact.firstname) || !this.functions.empty(contact.lastname)) {
label = contact.firstname + ' ' + contact.lastname;
if (!this.functions.empty(contact.firstname) && !this.functions.empty(contact.lastname)) {
label = `${contact.firstname} ${contact.lastname}`;
} else if (this.functions.empty(contact.firstname) && !this.functions.empty(contact.lastname)) {
label = contact.lastname;
} else if (!this.functions.empty(contact.firstname) && this.functions.empty(contact.lastname)) {
label = contact.firstname;
} else {
label = contact.company;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment