1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +00:00

[PM-8526] Set secureNote type when creating a new note (#10107)

This commit is contained in:
Shane Melton
2024-07-12 14:30:39 -07:00
committed by GitHub
parent b7e102dd6d
commit eceec4b908

View File

@@ -16,7 +16,7 @@ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
import { FormBuilder, ReactiveFormsModule } from "@angular/forms"; import { FormBuilder, ReactiveFormsModule } from "@angular/forms";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; 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 { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { import {
AsyncActionsModule, AsyncActionsModule,
@@ -185,6 +185,10 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci
this.updatedCipherView = Object.assign(this.updatedCipherView, this.originalCipherView); this.updatedCipherView = Object.assign(this.updatedCipherView, this.originalCipherView);
} else { } else {
this.updatedCipherView.type = this.config.cipherType; this.updatedCipherView.type = this.config.cipherType;
if (this.config.cipherType === CipherType.SecureNote) {
this.updatedCipherView.secureNote.type = SecureNoteType.Generic;
}
} }
this.loading = false; this.loading = false;