diff --git a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts index 4969ea2b16..d3d0703605 100644 --- a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts +++ b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts @@ -207,6 +207,7 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { private accountService: AccountService, private router: Router, private billingAccountProfileStateService: BillingAccountProfileStateService, + private premiumUpgradeService: PremiumUpgradePromptService, ) { this.updateTitle(); } @@ -297,6 +298,13 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { }; openAttachmentsDialog = async () => { + const canAccessAttachments = await firstValueFrom(this.canAccessAttachments$); + + if (!canAccessAttachments) { + await this.premiumUpgradeService.promptForPremium(); + return; + } + const dialogRef = this.dialogService.open( AttachmentsV2Component, { diff --git a/apps/web/src/app/vault/individual-vault/vault.component.ts b/apps/web/src/app/vault/individual-vault/vault.component.ts index 734ab5acf1..aac686f21a 100644 --- a/apps/web/src/app/vault/individual-vault/vault.component.ts +++ b/apps/web/src/app/vault/individual-vault/vault.component.ts @@ -611,6 +611,12 @@ export class VaultComponent implements OnInit, OnDestroy { const result = await lastValueFrom(this.vaultItemDialogRef.closed); this.vaultItemDialogRef = undefined; + // When the dialog is closed for a premium upgrade, return early as the user + // should be navigated to the subscription settings elsewhere + if (result === VaultItemDialogResult.PremiumUpgrade) { + return; + } + // If the dialog was closed by deleting the cipher, refresh the vault. if (result === VaultItemDialogResult.Deleted || result === VaultItemDialogResult.Saved) { this.refresh();