From f6b440adefaf84d6626f4ebefa5386071864622a Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 1 Apr 2024 02:09:23 +0200 Subject: [PATCH] Put available encrypt and sign options in corresponding menu options as title --- dev/View/Popup/Compose.js | 17 ++++++++++------- .../app/templates/Views/User/PopupsCompose.html | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index b8dd3d4a5..d21fbac02 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -336,6 +336,9 @@ export class ComposePopupView extends AbstractViewPopup { canMailvelope: () => this.encryptOptions.includes('Mailvelope'), canSign: () => this.signOptions().length, + encryptOptionsText: () => this.encryptOptions().join(', '), + signOptionsText: () => this.signOptions().map(o => o[0]).join(', '), + identitiesOptions: () => IdentityUserStore.map(item => ({ item: item, @@ -1396,13 +1399,6 @@ export class ComposePopupView extends AbstractViewPopup { OpenPGPUserStore.hasPublicKeyForEmails(recipients) && options.push('OpenPGP'); - if (await MailvelopeUserStore.hasPublicKeyForEmails(recipients)) { - options.push('Mailvelope'); - } else { - 'mailvelope' === this.viewArea() && this.bodyArea(); -// this.dropMailvelope(); - } - const count = recipients.length, identity = this.currentIdentity(), from = (identity.smimeKey() && identity.smimeCertificate()) ? identity.email() : null; @@ -1412,6 +1408,13 @@ export class ComposePopupView extends AbstractViewPopup { || SMimeUserStore.find(certificate => email == certificate.emailAddress && certificate.smimeencrypt) ).length && options.push('S/MIME'); + + if (await MailvelopeUserStore.hasPublicKeyForEmails(recipients)) { + options.push('Mailvelope'); + } else { + 'mailvelope' === this.viewArea() && this.bodyArea(); +// this.dropMailvelope(); + } } console.dir({encryptOptions:options}); diff --git a/snappymail/v/0.0.0/app/templates/Views/User/PopupsCompose.html b/snappymail/v/0.0.0/app/templates/Views/User/PopupsCompose.html index 1501b9f86..7e16db305 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/PopupsCompose.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/PopupsCompose.html @@ -61,13 +61,13 @@
  • - +
  • - +