mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
Put available encrypt and sign options in corresponding menu options as title
This commit is contained in:
parent
9b309c31bd
commit
f6b440adef
|
@ -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});
|
||||
|
|
|
@ -61,13 +61,13 @@
|
|||
</a>
|
||||
</li>
|
||||
<li data-bind="toggle: doSign, visible: canSign">
|
||||
<a>
|
||||
<a data-bind="attr:{title: signOptionsText}">
|
||||
<i class="fontastic" data-bind="text: doSign() ? '☑' : '☐'"></i>
|
||||
<span data-icon="✍" data-i18n="CRYPTO/SIGN"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li data-bind="toggle: doEncrypt, visible: canEncrypt">
|
||||
<a>
|
||||
<a data-bind="attr:{title: encryptOptionsText}">
|
||||
<i class="fontastic" data-bind="text: doEncrypt() || 'mailvelope' == viewArea() ? '☑' : '☐'"></i>
|
||||
<span data-icon="🔒" data-i18n="CRYPTO/ENCRYPT"></span>
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue