Skip to content

Commit b44637e

Browse files
committed
feat(ai): use liveEdit entitlement as temporary AI gate
AI entitlement is not yet implemented in the backend. Use getLiveEditEntitlement as a proxy for Pro plan status and add a TODO with the full getAIEntitlement flow for when the backend is ready.
1 parent e94c7b5 commit b44637e

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

src/core-ai/AIChatPanel.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,27 @@ define(function (require, exports, module) {
247247
_checkAvailability();
248248
return;
249249
}
250-
EntitlementsManager.getAIEntitlement().then(function (entitlement) {
251-
if (entitlement.aiDisabledByAdmin) {
252-
_renderAdminDisabledUI();
253-
} else if (entitlement.activated) {
250+
if (!EntitlementsManager.isLoggedIn()) {
251+
_renderLoginUI();
252+
return;
253+
}
254+
// TODO: Switch to EntitlementsManager.getAIEntitlement() once AI entitlement is
255+
// implemented in the backend. For now, reuse liveEdit entitlement as a proxy for
256+
// "has Pro plan". Once AI entitlement is available, the check should be:
257+
// EntitlementsManager.getAIEntitlement().then(function (entitlement) {
258+
// if (entitlement.aiDisabledByAdmin) {
259+
// _renderAdminDisabledUI();
260+
// } else if (entitlement.activated) {
261+
// _checkAvailability();
262+
// } else if (entitlement.needsLogin) {
263+
// _renderLoginUI();
264+
// } else {
265+
// _renderUpsellUI(entitlement);
266+
// }
267+
// });
268+
EntitlementsManager.getLiveEditEntitlement().then(function (entitlement) {
269+
if (entitlement.activated) {
254270
_checkAvailability();
255-
} else if (entitlement.needsLogin) {
256-
_renderLoginUI();
257271
} else {
258272
_renderUpsellUI(entitlement);
259273
}

0 commit comments

Comments
 (0)