From eceec4b908c2de694567ed89a7a37235f7fdf323 Mon Sep 17 00:00:00 2001 From: Shane Melton Date: Fri, 12 Jul 2024 14:30:39 -0700 Subject: [PATCH] [PM-8526] Set secureNote type when creating a new note (#10107) --- .../src/cipher-form/components/cipher-form.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/vault/src/cipher-form/components/cipher-form.component.ts b/libs/vault/src/cipher-form/components/cipher-form.component.ts index 9d5e0684d2d..00226b25ea6 100644 --- a/libs/vault/src/cipher-form/components/cipher-form.component.ts +++ b/libs/vault/src/cipher-form/components/cipher-form.component.ts @@ -16,7 +16,7 @@ import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { FormBuilder, ReactiveFormsModule } from "@angular/forms"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { CipherType } from "@bitwarden/common/vault/enums"; +import { CipherType, SecureNoteType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { AsyncActionsModule, @@ -185,6 +185,10 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci this.updatedCipherView = Object.assign(this.updatedCipherView, this.originalCipherView); } else { this.updatedCipherView.type = this.config.cipherType; + + if (this.config.cipherType === CipherType.SecureNote) { + this.updatedCipherView.secureNote.type = SecureNoteType.Generic; + } } this.loading = false;