From 519889f8f49ea01feb2796efe6115477c15cb879 Mon Sep 17 00:00:00 2001 From: SmithThe4th Date: Fri, 7 Nov 2025 10:54:04 -0500 Subject: [PATCH] Persist ssh key changes when extension loses focus (#17267) --- .../sshkey-section/sshkey-section.component.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/vault/src/cipher-form/components/sshkey-section/sshkey-section.component.ts b/libs/vault/src/cipher-form/components/sshkey-section/sshkey-section.component.ts index 649dd807f29..990de9574ab 100644 --- a/libs/vault/src/cipher-form/components/sshkey-section/sshkey-section.component.ts +++ b/libs/vault/src/cipher-form/components/sshkey-section/sshkey-section.component.ts @@ -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,