@@ -461,6 +461,7 @@ define(function (require, exports, module) {
461461 if ( entitlements . plan && ( ! entitlements . plan . validTill || currentDate > entitlements . plan . validTill ) ) {
462462 entitlements . plan = {
463463 ...entitlements . plan ,
464+ isSubscriber : false ,
464465 paidSubscriber : false ,
465466 name : Strings . USER_FREE_PLAN_NAME_DO_NOT_TRANSLATE ,
466467 fullName : Strings . USER_FREE_PLAN_NAME_DO_NOT_TRANSLATE ,
@@ -498,7 +499,8 @@ define(function (require, exports, module) {
498499 * ```javascript
499500 * {
500501 * plan: {
501- * paidSubscriber: true, // Always true for trial users
502+ * isSubscriber: true, // Always true for trial users
503+ * paidSubscriber: false, // if the user is a paid for the plan, or is it an unpaid promo
502504 * name: "Phoenix Pro"
503505 * fullName: "Phoenix Pro" // this can be deceptive name like "Phoenix Pro For Education" to use in
504506 * // profile popup, not main branding
@@ -514,11 +516,12 @@ define(function (require, exports, module) {
514516 * ```
515517 *
516518 * **For logged-in trial users:**
517- * - If remote response has `plan.paidSubscriber : false`, injects `paidSubscriber : true`
519+ * - If remote response has `plan.isSubscriber : false`, injects `isSubscriber : true`
518520 * - Adds `isInProTrial: true` and `trialDaysRemaining`
519521 * - Injects `entitlements.liveEdit.activated: true`
520- * - Note: Trial users may not be actual paid subscribers, but `paidSubscriber: true` is set
521- * so all Phoenix code treats them as paid subscribers
522+ * - Note: Trial users may not be actual paid subscribers, but `isSubscriber: true` is set
523+ * so all Phoenix code treats them as subscribers. to check if they actually paid or not, use
524+ * `paidSubscriber` field.
522525 *
523526 * **For logged-in users (full remote response):**
524527 * ```javascript
@@ -529,6 +532,7 @@ define(function (require, exports, module) {
529532 * name: "Phoenix Pro",
530533 * fullName: "Phoenix Pro" // this can be deceptive name like "Phoenix Pro For Education" to use in
531534 * // profile popup, not main branding
535+ * isSubscriber: boolean,
532536 * paidSubscriber: boolean,
533537 * validTill: number // Timestamp
534538 * },
@@ -574,7 +578,7 @@ define(function (require, exports, module) {
574578 *
575579 * // Get current entitlements
576580 * const entitlements = await LoginService.getEffectiveEntitlements();
577- * if (entitlements?.plan?.paidSubscriber ) {
581+ * if (entitlements?.plan?.isSubscriber ) {
578582 * // Enable pro features
579583 * }
580584 * if (entitlements?.entitlements?.liveEdit?.activated) {
@@ -597,8 +601,8 @@ define(function (require, exports, module) {
597601 // now we need to grant trial, as user is entitled to trial if he is here.
598602 // User has active server plan(either with login or device license)
599603 if ( serverEntitlements && serverEntitlements . plan ) {
600- if ( serverEntitlements . plan . paidSubscriber ) {
601- // Already a paid subscriber(or has device license), return as-is
604+ if ( serverEntitlements . plan . isSubscriber ) {
605+ // Already a subscriber(or has device license), return as-is
602606 // never inject trail data in this case.
603607 return serverEntitlements ;
604608 }
@@ -608,7 +612,8 @@ define(function (require, exports, module) {
608612 ...serverEntitlements ,
609613 plan : {
610614 ...serverEntitlements . plan ,
611- paidSubscriber : true ,
615+ isSubscriber : true ,
616+ paidSubscriber : serverEntitlements . plan . paidSubscriber || false ,
612617 name : brackets . config . main_pro_plan ,
613618 fullName : brackets . config . main_pro_plan ,
614619 validTill : dateNowFn ( ) + trialDaysRemaining * MS_IN_DAY
@@ -632,7 +637,8 @@ define(function (require, exports, module) {
632637 // Non-logged-in, non licensed user with trial - return synthetic entitlements
633638 return {
634639 plan : {
635- paidSubscriber : true ,
640+ isSubscriber : true ,
641+ paidSubscriber : false ,
636642 name : brackets . config . main_pro_plan ,
637643 fullName : brackets . config . main_pro_plan ,
638644 validTill : dateNowFn ( ) + trialDaysRemaining * MS_IN_DAY
0 commit comments