From 2e38f409ec745fd655cae41e108a9ad93bcf8afa Mon Sep 17 00:00:00 2001 From: Jason Ng Date: Wed, 25 Feb 2026 13:05:29 -0500 Subject: [PATCH] [PM-31408] update archive flag check in desktop vault (#19230) --- apps/desktop/src/vault/app/vault-v3/vault.component.ts | 5 ++++- apps/desktop/src/vault/app/vault/vault-v2.component.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/vault/app/vault-v3/vault.component.ts b/apps/desktop/src/vault/app/vault-v3/vault.component.ts index 44005dc45f6..c5a122162c6 100644 --- a/apps/desktop/src/vault/app/vault-v3/vault.component.ts +++ b/apps/desktop/src/vault/app/vault-v3/vault.component.ts @@ -201,6 +201,9 @@ export class VaultComponent implements OnInit, OnDestroy, CopyClickListener { ), { initialValue: false }, ); + readonly archiveFlagEnabled = toSignal(this.cipherArchiveService.hasArchiveFlagEnabled$, { + initialValue: false, + }); protected itemTypesIcon = ItemTypes; private organizations$: Observable = this.accountService.activeAccount$.pipe( @@ -601,7 +604,7 @@ export class VaultComponent implements OnInit, OnDestroy, CopyClickListener { } } - if (userCanArchive && !cipher.isDeleted && !cipher.isArchived) { + if (this.archiveFlagEnabled() && !cipher.isDeleted && !cipher.isArchived) { menu.push({ label: this.i18nService.t("archiveVerb"), click: async () => { diff --git a/apps/desktop/src/vault/app/vault/vault-v2.component.ts b/apps/desktop/src/vault/app/vault/vault-v2.component.ts index ae049325d8b..5264c744311 100644 --- a/apps/desktop/src/vault/app/vault/vault-v2.component.ts +++ b/apps/desktop/src/vault/app/vault/vault-v2.component.ts @@ -12,6 +12,7 @@ import { ViewChild, ViewContainerRef, } from "@angular/core"; +import { toSignal } from "@angular/core/rxjs-interop"; import { ActivatedRoute, Router } from "@angular/router"; import { firstValueFrom, @@ -211,6 +212,9 @@ export class VaultV2Component collections: CollectionView[] | null = null; config: CipherFormConfig | null = null; readonly userHasPremium = signal(false); + readonly archiveFlagEnabled = toSignal(this.cipherArchiveService.hasArchiveFlagEnabled$, { + initialValue: false, + }); protected itemTypesIcon = ItemTypes; /** Tracks the disabled status of the edit cipher form */ @@ -620,7 +624,7 @@ export class VaultV2Component } } - if (userCanArchive && !cipher.isDeleted && !cipher.isArchived) { + if (this.archiveFlagEnabled() && !cipher.isDeleted && !cipher.isArchived) { menu.push({ label: this.i18nService.t("archiveVerb"), click: async () => {