From 020851c11ed67964004172fc39fbc6a3ce8eef47 Mon Sep 17 00:00:00 2001 From: Shlomo Zalman Heigh Date: Thu, 29 Aug 2024 19:29:42 -0400 Subject: [PATCH] If an org has only one collection, check it by default 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 909a905e9b0..a1989ae8001 100644 --- a/libs/angular/src/vault/components/add-edit.component.ts +++ b/libs/angular/src/vault/components/add-edit.component.ts @@ -614,6 +614,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;