mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 16:07:03 +03:00
Put available encrypt and sign options in corresponding menu options as title
This commit is contained in:
parent
9b309c31bd
commit
f6b440adef
2 changed files with 12 additions and 9 deletions
|
|
@ -336,6 +336,9 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
canMailvelope: () => this.encryptOptions.includes('Mailvelope'),
|
canMailvelope: () => this.encryptOptions.includes('Mailvelope'),
|
||||||
canSign: () => this.signOptions().length,
|
canSign: () => this.signOptions().length,
|
||||||
|
|
||||||
|
encryptOptionsText: () => this.encryptOptions().join(', '),
|
||||||
|
signOptionsText: () => this.signOptions().map(o => o[0]).join(', '),
|
||||||
|
|
||||||
identitiesOptions: () =>
|
identitiesOptions: () =>
|
||||||
IdentityUserStore.map(item => ({
|
IdentityUserStore.map(item => ({
|
||||||
item: item,
|
item: item,
|
||||||
|
|
@ -1396,13 +1399,6 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
OpenPGPUserStore.hasPublicKeyForEmails(recipients)
|
OpenPGPUserStore.hasPublicKeyForEmails(recipients)
|
||||||
&& options.push('OpenPGP');
|
&& options.push('OpenPGP');
|
||||||
|
|
||||||
if (await MailvelopeUserStore.hasPublicKeyForEmails(recipients)) {
|
|
||||||
options.push('Mailvelope');
|
|
||||||
} else {
|
|
||||||
'mailvelope' === this.viewArea() && this.bodyArea();
|
|
||||||
// this.dropMailvelope();
|
|
||||||
}
|
|
||||||
|
|
||||||
const count = recipients.length,
|
const count = recipients.length,
|
||||||
identity = this.currentIdentity(),
|
identity = this.currentIdentity(),
|
||||||
from = (identity.smimeKey() && identity.smimeCertificate()) ? identity.email() : null;
|
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)
|
|| SMimeUserStore.find(certificate => email == certificate.emailAddress && certificate.smimeencrypt)
|
||||||
).length
|
).length
|
||||||
&& options.push('S/MIME');
|
&& options.push('S/MIME');
|
||||||
|
|
||||||
|
if (await MailvelopeUserStore.hasPublicKeyForEmails(recipients)) {
|
||||||
|
options.push('Mailvelope');
|
||||||
|
} else {
|
||||||
|
'mailvelope' === this.viewArea() && this.bodyArea();
|
||||||
|
// this.dropMailvelope();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.dir({encryptOptions:options});
|
console.dir({encryptOptions:options});
|
||||||
|
|
|
||||||
|
|
@ -61,13 +61,13 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li data-bind="toggle: doSign, visible: canSign">
|
<li data-bind="toggle: doSign, visible: canSign">
|
||||||
<a>
|
<a data-bind="attr:{title: signOptionsText}">
|
||||||
<i class="fontastic" data-bind="text: doSign() ? '☑' : '☐'"></i>
|
<i class="fontastic" data-bind="text: doSign() ? '☑' : '☐'"></i>
|
||||||
<span data-icon="✍" data-i18n="CRYPTO/SIGN"></span>
|
<span data-icon="✍" data-i18n="CRYPTO/SIGN"></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li data-bind="toggle: doEncrypt, visible: canEncrypt">
|
<li data-bind="toggle: doEncrypt, visible: canEncrypt">
|
||||||
<a>
|
<a data-bind="attr:{title: encryptOptionsText}">
|
||||||
<i class="fontastic" data-bind="text: doEncrypt() || 'mailvelope' == viewArea() ? '☑' : '☐'"></i>
|
<i class="fontastic" data-bind="text: doEncrypt() || 'mailvelope' == viewArea() ? '☑' : '☐'"></i>
|
||||||
<span data-icon="🔒" data-i18n="CRYPTO/ENCRYPT"></span>
|
<span data-icon="🔒" data-i18n="CRYPTO/ENCRYPT"></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue