mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 07:39:02 +02:00
Merge pull request #25493 from overleaf/jdt-ai-assist-entitlement-fix
Access addOnCode correctly when determining bundle entitlement GitOrigin-RevId: c3aee15b3ef6fc1d32f24283ec848e600f0777f1
This commit is contained in:
committed by
Copybot
parent
50c2d8f32f
commit
1ec12e3d88
@@ -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)
|
||||
)
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user