diff --git a/libs/angular/src/vault/services/custom-nudges-services/empty-vault-nudge.service.ts b/libs/angular/src/vault/services/custom-nudges-services/empty-vault-nudge.service.ts index 9763c20299..3122bdac2e 100644 --- a/libs/angular/src/vault/services/custom-nudges-services/empty-vault-nudge.service.ts +++ b/libs/angular/src/vault/services/custom-nudges-services/empty-vault-nudge.service.ts @@ -44,18 +44,22 @@ export class EmptyVaultNudgeService extends DefaultSingleNudgeService { const hasManageCollections = collections.some( (c) => c.manage && orgIds.has(c.organizationId), ); - // Do not show nudge when - // user has previously dismissed nudge - // OR - // user belongs to an organization and cannot create collections || manage collections - if ( - nudgeStatus.hasBadgeDismissed || - nudgeStatus.hasSpotlightDismissed || - hasManageCollections || - canCreateCollections - ) { + + // When the user has dismissed the nudge or spotlight, return the nudge status directly + if (nudgeStatus.hasBadgeDismissed || nudgeStatus.hasSpotlightDismissed) { return of(nudgeStatus); } + + // When the user belongs to an organization and cannot create collections or manage collections, + // hide the nudge and spotlight + if (!hasManageCollections && !canCreateCollections) { + return of({ + hasSpotlightDismissed: true, + hasBadgeDismissed: true, + }); + } + + // Otherwise, return the nudge status based on the vault contents return of({ hasSpotlightDismissed: vaultHasContents, hasBadgeDismissed: vaultHasContents,