Disable Mailvelope "sign" message as it can't choose which key

This commit is contained in:
the-djmaze 2022-02-08 13:48:11 +01:00
parent c4ffcc708a
commit 398152be52
6 changed files with 22 additions and 17 deletions

View file

@ -1,7 +1,7 @@
import ko from 'ko';
import { Capa } from 'Common/Enums';
import { Settings } from 'Common/Globals';
import { SettingsCapa } from 'Common/Globals';
import { delegateRunOnDestroy } from 'Common/UtilsUser';
//import { EmailModel } from 'Model/Email';
@ -34,7 +34,7 @@ export const GnuPGUserStore = new class {
this.privateKeys = ko.observableArray();
}
loadKeyrings(/*identifier*/) {
loadKeyrings() {
this.keyring = null;
this.publicKeys([]);
this.privateKeys([]);
@ -104,7 +104,7 @@ export const GnuPGUserStore = new class {
* @returns {boolean}
*/
isSupported() {
return Settings.capa(Capa.GnuPG);
return SettingsCapa(Capa.GnuPG);
}
importKey(key, callback) {

View file

@ -1,5 +1,5 @@
import { Capa } from 'Common/Enums';
import { doc, createElement, Settings } from 'Common/Globals';
import { doc, createElement, SettingsCapa, SettingsGet } from 'Common/Globals';
import { staticLink } from 'Common/Links';
//import { showScreenPopup } from 'Knoin/Knoin';
@ -17,7 +17,7 @@ export const PgpUserStore = new class {
}
init() {
if (Settings.capa(Capa.OpenPGP) && window.crypto && crypto.getRandomValues) {
if (SettingsCapa(Capa.OpenPGP) && window.crypto && crypto.getRandomValues) {
const script = createElement('script', {src:staticLink('js/min/openpgp.min.js')});
script.onload = () => this.loadKeyrings();
script.onerror = () => {
@ -31,11 +31,12 @@ export const PgpUserStore = new class {
}
loadKeyrings(identifier) {
identifier = identifier || SettingsGet('Email');
if (window.mailvelope) {
var fn = keyring => {
this.mailvelopeKeyring = keyring;
console.log('mailvelope ready');
};
const fn = keyring => {
this.mailvelopeKeyring = keyring;
console.log('mailvelope ready');
};
mailvelope.getKeyring().then(fn, err => {
if (identifier) {
// attempt to create a new keyring for this app/user
@ -52,11 +53,11 @@ export const PgpUserStore = new class {
}
if (OpenPGPUserStore.isSupported()) {
OpenPGPUserStore.loadKeyrings(identifier);
OpenPGPUserStore.loadKeyrings();
}
if (Settings.capa(Capa.GnuPG)) {
GnuPGUserStore.loadKeyrings(identifier);
if (SettingsCapa(Capa.GnuPG)) {
GnuPGUserStore.loadKeyrings();
}
}