mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
Cleanup Email.toLine()
This commit is contained in:
parent
2af5257e10
commit
7585ac450e
3 changed files with 4 additions and 4 deletions
|
|
@ -148,7 +148,7 @@ export class EmailAddressesComponent {
|
|||
hook = (v && [',', ';', '\n'].includes(v.slice(-1))) ? EmailModel.splitEmailLine(val) : null,
|
||||
values = (hook || [val]).map(value => EmailModel.parseEmailLine(value))
|
||||
.flat(Infinity)
|
||||
.map(item => (item.toLine ? [item.toLine(false), item] : [item, null]));
|
||||
.map(item => (item.toLine ? [item.toLine(), item] : [item, null]));
|
||||
|
||||
if (values.length) {
|
||||
values.forEach(a => {
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ export class EmailModel extends AbstractModel {
|
|||
exists = true;
|
||||
}
|
||||
|
||||
result.push(address ? address.toLine(false) : item.name);
|
||||
result.push(address ? address.toLine() : item.name);
|
||||
});
|
||||
|
||||
return exists ? result : null;
|
||||
|
|
|
|||
|
|
@ -693,7 +693,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
(iError, data) => {
|
||||
if (!iError && isArray(data.Result)) {
|
||||
fResponse(
|
||||
data.Result.map(item => (item && item[0] ? (new EmailModel(item[0], item[1])).toLine(false) : null))
|
||||
data.Result.map(item => (item && item[0] ? (new EmailModel(item[0], item[1])).toLine() : null))
|
||||
.filter(v => v)
|
||||
);
|
||||
} else if (Notification.RequestAborted !== iError) {
|
||||
|
|
@ -870,7 +870,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
addEmailsTo(fKoValue, emails) {
|
||||
if (arrayLength(emails)) {
|
||||
const value = fKoValue().trim(),
|
||||
values = emails.map(item => item ? item.toLine(false) : null)
|
||||
values = emails.map(item => item ? item.toLine() : null)
|
||||
.validUnique();
|
||||
|
||||
fKoValue(value + (value ? ', ' : '') + values.join(', ').trim());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue