mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-02 21:12:02 +08:00
emailArrayToStringLineHelper() filter addresses without email address
and simplify ComposeType handling
This commit is contained in:
parent
974acaab90
commit
d898178985
1 changed files with 2 additions and 22 deletions
|
@ -67,7 +67,7 @@ const
|
|||
* @returns {string}
|
||||
*/
|
||||
emailArrayToStringLineHelper = (aList, bFriendly) =>
|
||||
aList.map(item => item.toLine(bFriendly)).join(', '),
|
||||
aList.filter(item => item.email).map(item => item.toLine(bFriendly)).join(', '),
|
||||
|
||||
reloadDraftFolder = () => {
|
||||
const draftsFolder = FolderUserStore.draftsFolder();
|
||||
|
@ -200,10 +200,6 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
};
|
||||
|
||||
this.oEditor = null;
|
||||
this.aDraftInfo = null;
|
||||
this.sInReplyTo = '';
|
||||
this.bFromDraft = false;
|
||||
this.sReferences = '';
|
||||
|
||||
this.sLastFocusedField = 'to';
|
||||
|
||||
|
@ -849,33 +845,17 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
break;
|
||||
|
||||
case ComposeType.Draft:
|
||||
this.to(emailArrayToStringLineHelper(message.to));
|
||||
this.cc(emailArrayToStringLineHelper(message.cc));
|
||||
this.bcc(emailArrayToStringLineHelper(message.bcc));
|
||||
this.replyTo(emailArrayToStringLineHelper(message.replyTo));
|
||||
|
||||
this.bFromDraft = true;
|
||||
|
||||
this.draftsFolder(message.folder);
|
||||
this.draftUid(message.uid);
|
||||
|
||||
this.subject(sSubject);
|
||||
this.prepareMessageAttachments(message, msgComposeType);
|
||||
|
||||
this.aDraftInfo = 3 === arrayLength(aDraftInfo) ? aDraftInfo : null;
|
||||
this.sInReplyTo = message.inReplyTo;
|
||||
this.sReferences = message.references;
|
||||
break;
|
||||
|
||||
// fallthrough
|
||||
case ComposeType.EditAsNew:
|
||||
this.to(emailArrayToStringLineHelper(message.to));
|
||||
this.cc(emailArrayToStringLineHelper(message.cc));
|
||||
this.bcc(emailArrayToStringLineHelper(message.bcc));
|
||||
this.replyTo(emailArrayToStringLineHelper(message.replyTo));
|
||||
|
||||
this.subject(sSubject);
|
||||
this.prepareMessageAttachments(message, msgComposeType);
|
||||
|
||||
this.aDraftInfo = 3 === arrayLength(aDraftInfo) ? aDraftInfo : null;
|
||||
this.sInReplyTo = message.inReplyTo;
|
||||
this.sReferences = message.references;
|
||||
|
|
Loading…
Reference in a new issue