1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

Persist ssh key changes when extension loses focus (#17267)

This commit is contained in:
SmithThe4th
2025-11-07 10:54:04 -05:00
committed by GitHub
parent f992b80161
commit 519889f8f4

View File

@@ -89,8 +89,11 @@ export class SshKeySectionComponent implements OnInit {
}
async ngOnInit() {
if (this.originalCipherView?.sshKey) {
this.setInitialValues();
const prefillCipher = this.cipherFormContainer.getInitialCipherView();
const sshKeyView = prefillCipher?.sshKey ?? this.originalCipherView?.sshKey;
if (sshKeyView) {
this.setInitialValues(sshKeyView);
} else {
await this.generateSshKey();
}
@@ -114,8 +117,8 @@ export class SshKeySectionComponent implements OnInit {
}
/** Set form initial form values from the current cipher */
private setInitialValues() {
const { privateKey, publicKey, keyFingerprint } = this.originalCipherView.sshKey;
private setInitialValues(sshKeyView: SshKeyView) {
const { privateKey, publicKey, keyFingerprint } = sshKeyView;
this.sshKeyForm.setValue({
privateKey,