mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08: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 = () => {
|
||||
let pass = isPrivate ? prompt('Passphrase') : true;
|
||||
if (pass) {
|
||||
Remote.request('GnupgExportKey',
|
||||
const fetch = pass => Remote.request('GnupgExportKey',
|
||||
(iError, oData) => {
|
||||
if (oData && oData.Result) {
|
||||
key.armor = oData.Result;
|
||||
|
@ -81,9 +79,15 @@ export const GnuPGUserStore = new class {
|
|||
}, {
|
||||
KeyId: key.id,
|
||||
isPrivate: isPrivate,
|
||||
Passphrase: isPrivate ? pass : ''
|
||||
Passphrase: pass
|
||||
}
|
||||
);
|
||||
if (isPrivate) {
|
||||
askPassphrase(key, 'POPUP_VIEW_TITLE').then(passphrase => {
|
||||
(null !== passphrase) && fetch(passphrase);
|
||||
});
|
||||
} else {
|
||||
fetch('');
|
||||
}
|
||||
};
|
||||
return key;
|
||||
|
|
Loading…
Reference in a new issue