mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Also use AskPopupView instead of prompt() to view GnuPG private key
This commit is contained in:
parent
8134a2567d
commit
c4ffcc708a
1 changed files with 8 additions and 4 deletions
|
|
@ -70,9 +70,7 @@ export const GnuPGUserStore = new class {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
key.view = () => {
|
key.view = () => {
|
||||||
let pass = isPrivate ? prompt('Passphrase') : true;
|
const fetch = pass => Remote.request('GnupgExportKey',
|
||||||
if (pass) {
|
|
||||||
Remote.request('GnupgExportKey',
|
|
||||||
(iError, oData) => {
|
(iError, oData) => {
|
||||||
if (oData && oData.Result) {
|
if (oData && oData.Result) {
|
||||||
key.armor = oData.Result;
|
key.armor = oData.Result;
|
||||||
|
|
@ -81,9 +79,15 @@ export const GnuPGUserStore = new class {
|
||||||
}, {
|
}, {
|
||||||
KeyId: key.id,
|
KeyId: key.id,
|
||||||
isPrivate: isPrivate,
|
isPrivate: isPrivate,
|
||||||
Passphrase: isPrivate ? pass : ''
|
Passphrase: pass
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
if (isPrivate) {
|
||||||
|
askPassphrase(key, 'POPUP_VIEW_TITLE').then(passphrase => {
|
||||||
|
(null !== passphrase) && fetch(passphrase);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
fetch('');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return key;
|
return key;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue