fixes
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
startCheckout,
|
||||
startCreditPackCheckout,
|
||||
redirectToCheckout,
|
||||
canSelfServePurchase,
|
||||
type StripeStatus
|
||||
} from "$lib/stripe-billing";
|
||||
import { CREDIT_PACKS } from "$lib/components/pricing/credit-packs";
|
||||
@@ -255,8 +256,12 @@
|
||||
);
|
||||
const atProductLimit = $derived(Boolean(credits?.at_product_limit) && !enterprise);
|
||||
const nextUpgradePlan = $derived(nextSelfServeUpgradePlan(planName));
|
||||
const purchasesEnabled = $derived(
|
||||
canSelfServePurchase(stripe, { isPlatformAdmin })
|
||||
);
|
||||
const showQuickUpgrade = $derived(
|
||||
canManageBilling &&
|
||||
purchasesEnabled &&
|
||||
!enterprise &&
|
||||
!payg &&
|
||||
!isLegacyPlan(plan) &&
|
||||
@@ -450,6 +455,10 @@
|
||||
<Alert message={error} />
|
||||
<Alert tone="success" message={success} />
|
||||
|
||||
{#if canManageBilling && !purchasesEnabled}
|
||||
<Alert tone="info" message={i18n.t("billing.checkoutUnavailable")} />
|
||||
{/if}
|
||||
|
||||
{#if recovery}
|
||||
<UpgradeBanner
|
||||
tone={recovery.tone}
|
||||
@@ -615,7 +624,7 @@
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{#if canManageBilling && !enterprise && planAssigned}
|
||||
{#if canManageBilling && purchasesEnabled && !enterprise && planAssigned}
|
||||
<section class="space-y-3 rounded-lg border border-border bg-card px-4 py-4">
|
||||
<div>
|
||||
<h2 class="text-base font-semibold tracking-tight">{i18n.t("billing.buyCreditPacks")}</h2>
|
||||
|
||||
Reference in New Issue
Block a user