@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 +1 -1
- package/src/billing/BillingTab.jsx +11 -4
package/package.json
CHANGED
|
@@ -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
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
|
|
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);
|