From 1ec12e3d88b45ca93abf1d5b960b50a042c94ddc Mon Sep 17 00:00:00 2001 From: Jimmy Domagala-Tang Date: Mon, 12 May 2025 06:19:39 -0400 Subject: [PATCH] Merge pull request #25493 from overleaf/jdt-ai-assist-entitlement-fix Access addOnCode correctly when determining bundle entitlement GitOrigin-RevId: c3aee15b3ef6fc1d32f24283ec848e600f0777f1 --- .../web/app/src/Features/Subscription/SubscriptionLocator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/app/src/Features/Subscription/SubscriptionLocator.js b/services/web/app/src/Features/Subscription/SubscriptionLocator.js index ac0fa5918a..8526ad0fb2 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionLocator.js +++ b/services/web/app/src/Features/Subscription/SubscriptionLocator.js @@ -121,9 +121,11 @@ const SubscriptionLocator = { async hasAiAssist(userOrId) { const userId = SubscriptionLocator._getUserId(userOrId) const subscription = await Subscription.findOne({ admin_id: userId }).exec() + // todo: as opposed to recurlyEntities which use addon.code, subscription model uses addon.addOnCode + // which we hope to align via https://github.com/overleaf/internal/issues/25494 return Boolean( isStandaloneAiAddOnPlanCode(subscription?.planCode) || - subscription?.addOns?.some(addOn => addOn.code === AI_ADD_ON_CODE) + subscription?.addOns?.some(addOn => addOn.addOnCode === AI_ADD_ON_CODE) ) },