mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Improved #1286 to be in line with all code
This commit is contained in:
parent
65d469f71a
commit
08257f47cb
42 changed files with 98 additions and 65 deletions
|
|
@ -140,24 +140,22 @@ export class ContactModel extends AbstractModel {
|
|||
*/
|
||||
getNameAndEmailHelper() {
|
||||
let name = (this.givenName() + ' ' + this.surName()).trim(),
|
||||
email;
|
||||
email = [],
|
||||
addresses = this.email();
|
||||
|
||||
if (this.sendToAll()) {
|
||||
email = [];
|
||||
this.email().forEach(function (key){
|
||||
email.push(key?.value())
|
||||
});
|
||||
} else {
|
||||
email = this.email()[0]?.value();
|
||||
addresses.forEach(key => email.push(key.value()));
|
||||
} else if (addresses.length) {
|
||||
email.push(addresses[0].value());
|
||||
}
|
||||
/*
|
||||
// this.jCard.getOne('fn')?.notEmpty() ||
|
||||
this.jCard.parseFullName({set:true});
|
||||
// let name = this.jCard.getOne('nickname'),
|
||||
let name = this.jCard.getOne('fn'),
|
||||
email = this.jCard.getOne('email');
|
||||
email = [this.jCard.getOne('email')];
|
||||
*/
|
||||
return email ? [email, name] : null;
|
||||
return email.length ? [name, email] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -332,10 +330,6 @@ export class ContactModel extends AbstractModel {
|
|||
+ (this.focused() ? ' focused' : '');
|
||||
}
|
||||
|
||||
sendToAllDefaultValue() {
|
||||
return (this.sendToAll() ? ' checked' : '');
|
||||
}
|
||||
|
||||
sendToAllDisplayStatus() {
|
||||
return this.email.length > 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue