mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
#89 Fix Mailvelope hasPrivateKey() detection
Proper rename OpenPGP Key viewer
This commit is contained in:
parent
b06b04a579
commit
76226f45ca
41 changed files with 252 additions and 200 deletions
|
|
@ -2,9 +2,9 @@ import { Scope } from 'Common/Enums';
|
|||
import { doc } from 'Common/Globals';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
class ViewOpenPgpKeyPopupView extends AbstractViewPopup {
|
||||
class OpenPgpKeyPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super('ViewOpenPgpKey');
|
||||
super('OpenPgpKey');
|
||||
|
||||
this.addObservables({
|
||||
key: '',
|
||||
|
|
@ -21,18 +21,25 @@ class ViewOpenPgpKeyPopupView extends AbstractViewPopup {
|
|||
range.selectNodeContents(el);
|
||||
sel.addRange(range);
|
||||
}
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(this.key()).then(
|
||||
() => console.log('Copied to clipboard'),
|
||||
err => console.error(err)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
onShow(openPgpKey) {
|
||||
// TODO: show more info
|
||||
this.key(openPgpKey ? openPgpKey.armor : '');
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
shortcuts.add('a', 'meta', Scope.ViewOpenPgpKey, () => {
|
||||
shortcuts.add('a', 'meta', Scope.OpenPgpKey, () => {
|
||||
this.selectKey();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export { ViewOpenPgpKeyPopupView, ViewOpenPgpKeyPopupView as default };
|
||||
export { OpenPgpKeyPopupView, OpenPgpKeyPopupView as default };
|
||||
Loading…
Add table
Add a link
Reference in a new issue