mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Replaced prompt() into a AskPopupView.password() Promise
This commit is contained in:
parent
1f0af5c0ac
commit
d9f50fa829
3 changed files with 38 additions and 8 deletions
|
|
@ -11,8 +11,12 @@ import Remote from 'Remote/User/Fetch';
|
|||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
import { OpenPgpKeyPopupView } from 'View/Popup/OpenPgpKey';
|
||||
import { AskPopupView } from 'View/Popup/Ask';
|
||||
|
||||
const
|
||||
askPassphrase = async privateKey =>
|
||||
await AskPopupView.password('GnuPG key<br>' + privateKey.id + ' ' + privateKey.emails[0]),
|
||||
|
||||
findGnuPGKey = (keys, query, sign) =>
|
||||
keys.find(key =>
|
||||
key[sign ? 'can_sign' : 'can_decrypt']
|
||||
|
|
@ -169,7 +173,7 @@ export const GnuPGUserStore = new class {
|
|||
Uid: message.uid,
|
||||
PartId: pgpInfo.PartId,
|
||||
KeyId: key.id,
|
||||
Passphrase: prompt('GnuPG Passphrase for ' + key.id + ' ' + key.uids[0].uid),
|
||||
Passphrase: await askPassphrase(key),
|
||||
Data: '' // message.plain() optional
|
||||
}
|
||||
if (null !== params.Passphrase) {
|
||||
|
|
@ -199,4 +203,12 @@ export const GnuPGUserStore = new class {
|
|||
}
|
||||
}
|
||||
|
||||
async sign(/*text, privateKey, detached*/) {
|
||||
throw 'Sign failed';
|
||||
}
|
||||
|
||||
async encrypt(/*text, recipients, signPrivateKey*/) {
|
||||
throw 'Encrypt failed';
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue