From b4f76a7932acf601c3beed2334a326475ce386b8 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 10 Jul 2020 17:07:01 -0400 Subject: [PATCH] feat(mail): handle multiple mail identities Fixes #768, fixes #4602 --- UI/Templates/MailerUI/UIxMailEditor.wox | 2 +- UI/Templates/PreferencesUI/UIxAccountEditor.wox | 2 +- .../js/Mailer/Account.service.js | 17 ++++++----------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/UI/Templates/MailerUI/UIxMailEditor.wox b/UI/Templates/MailerUI/UIxMailEditor.wox index fa29a9a1e..85e34c3f1 100644 --- a/UI/Templates/MailerUI/UIxMailEditor.wox +++ b/UI/Templates/MailerUI/UIxMailEditor.wox @@ -49,7 +49,7 @@ md-highlight-flags="gi">{{ identity.full }}
- +
diff --git a/UI/Templates/PreferencesUI/UIxAccountEditor.wox b/UI/Templates/PreferencesUI/UIxAccountEditor.wox index e208ca156..da2f5db3f 100644 --- a/UI/Templates/PreferencesUI/UIxAccountEditor.wox +++ b/UI/Templates/PreferencesUI/UIxAccountEditor.wox @@ -118,7 +118,7 @@
- +
' + identity.signature + ''); - identity.textSignature = _.map(element.contents(), 'textContent').join(' ').trim(); - } else { - identity.textSignature = ''; - } - return identity.textSignature; + Account.prototype.getTextSignature = function(identity) { + if (identity.signature) { + var element = angular.element('
' + identity.signature + '
'); + identity.textSignature = _.map(element.contents(), 'textContent').join(' ').trim(); } else { - throw Error('Index of identity is out of range'); + identity.textSignature = ''; } + return identity.textSignature; }; /**