@growth-operations/ui-shared 1.5.6 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-operations/ui-shared",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Shared HubSpot UI-extension modules (Home, Billing) for Growth Operations apps.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -170,10 +170,17 @@ function usePortalSession({ context, state, appKey }) {
170
170
  return;
171
171
  }
172
172
  // No Stripe customer yet → don't even try to open a portal. An install
173
- // that hasn't been provisioned (no entitlement, or status null/
174
- // not_installed) has nothing to manage; show the calm "not ready" state.
175
- const status = state?.entitlement?.status;
176
- if (!state.entitlement || status == null || status === "not_installed") {
173
+ // that hasn't been provisioned has nothing to manage; show the calm "not
174
+ // ready" state. The credits arm has NO `status` field (only the
175
+ // not_installed shell does) but DOES carry `plan` once paid — treat a set
176
+ // `plan` as ready so a paid credit customer gets the Manage button. Only
177
+ // the trial arm relies on `status`.
178
+ const ent = state?.entitlement;
179
+ const status = ent?.status;
180
+ const onPaidPlan = !!ent?.plan;
181
+ const notProvisioned =
182
+ !ent || status === "not_installed" || (status == null && !onPaidPlan);
183
+ if (notProvisioned) {
177
184
  if (mounted.current) {
178
185
  setNotReady(true);
179
186
  setLoading(false);