Many more changes for #89

This commit is contained in:
the-djmaze 2022-01-20 16:38:27 +01:00
parent 3cc3a76b23
commit a7eeeb4f55
18 changed files with 310 additions and 236 deletions

View file

@ -1,6 +1,7 @@
import { pInt } from 'Common/Utils';
import { PgpUserStore } from 'Stores/User/Pgp';
import { IdentityUserStore } from 'Stores/User/Identity';
import { decorateKoCommands } from 'Knoin/Knoin';
import { AbstractViewPopup } from 'Knoin/AbstractViews';
@ -9,6 +10,8 @@ class NewOpenPgpKeyPopupView extends AbstractViewPopup {
constructor() {
super('NewOpenPgpKey');
this.identities = IdentityUserStore;
this.addObservables({
email: '',
emailError: false,
@ -63,6 +66,9 @@ class NewOpenPgpKeyPopupView extends AbstractViewPopup {
openpgpKeyring.store();
PgpUserStore.reloadOpenPgpKeys();
PgpUserStore.gnupgImportKey(keyPair.privateKeyArmored);
this.cancelCommand();
}
})
@ -87,13 +93,11 @@ class NewOpenPgpKeyPopupView extends AbstractViewPopup {
}
onShow() {
this.name('');
this.name(IdentityUserStore()[0].name());
this.password('');
this.email('');
this.email(IdentityUserStore()[0].email());
this.emailError(false);
this.keyBitLength(4096);
this.submitError('');
}
}