mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
Persist ssh key changes when extension loses focus (#17267)
This commit is contained in:
@@ -89,8 +89,11 @@ export class SshKeySectionComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
if (this.originalCipherView?.sshKey) {
|
const prefillCipher = this.cipherFormContainer.getInitialCipherView();
|
||||||
this.setInitialValues();
|
const sshKeyView = prefillCipher?.sshKey ?? this.originalCipherView?.sshKey;
|
||||||
|
|
||||||
|
if (sshKeyView) {
|
||||||
|
this.setInitialValues(sshKeyView);
|
||||||
} else {
|
} else {
|
||||||
await this.generateSshKey();
|
await this.generateSshKey();
|
||||||
}
|
}
|
||||||
@@ -114,8 +117,8 @@ export class SshKeySectionComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Set form initial form values from the current cipher */
|
/** Set form initial form values from the current cipher */
|
||||||
private setInitialValues() {
|
private setInitialValues(sshKeyView: SshKeyView) {
|
||||||
const { privateKey, publicKey, keyFingerprint } = this.originalCipherView.sshKey;
|
const { privateKey, publicKey, keyFingerprint } = sshKeyView;
|
||||||
|
|
||||||
this.sshKeyForm.setValue({
|
this.sshKeyForm.setValue({
|
||||||
privateKey,
|
privateKey,
|
||||||
|
|||||||
Reference in New Issue
Block a user