From a4123cb8bafe377c8847ebfd500c112ea96f1096 Mon Sep 17 00:00:00 2001 From: Shlomo Zalman Heigh Date: Mon, 7 Oct 2024 10:22:10 -0400 Subject: [PATCH] [PM-11497] If an org has only one collection, check it by default (#10806) Signed-off-by: Shlomo Zalman Heigh --- libs/angular/src/vault/components/add-edit.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/angular/src/vault/components/add-edit.component.ts b/libs/angular/src/vault/components/add-edit.component.ts index 960a226b1c..dc782e6e3a 100644 --- a/libs/angular/src/vault/components/add-edit.component.ts +++ b/libs/angular/src/vault/components/add-edit.component.ts @@ -605,6 +605,10 @@ export class AddEditComponent implements OnInit, OnDestroy { this.collections = this.writeableCollections?.filter( (c) => c.organizationId === this.cipher.organizationId, ); + // If there's only one collection, check it by default + if (this.collections.length === 1) { + (this.collections[0] as any).checked = true; + } const org = await this.organizationService.get(this.cipher.organizationId); if (org != null) { this.cipher.organizationUseTotp = org.useTotp;