adsasdasd
This commit is contained in:
@@ -328,8 +328,11 @@ export default function PlansAndBillingPage() {
|
||||
|
||||
const currentSubscription = subscriptions.find((sub) => sub.status === 'active') || subscriptions[0];
|
||||
const currentPlanId = typeof currentSubscription?.plan === 'object' ? currentSubscription.plan.id : currentSubscription?.plan;
|
||||
const currentPlan = plans.find((p) => p.id === currentPlanId);
|
||||
const hasActivePlan = Boolean(currentPlanId);
|
||||
// Fallback to account plan if subscription is missing
|
||||
const accountPlanId = user?.account?.plan?.id;
|
||||
const effectivePlanId = currentPlanId || accountPlanId;
|
||||
const currentPlan = plans.find((p) => p.id === effectivePlanId) || user?.account?.plan;
|
||||
const hasActivePlan = Boolean(effectivePlanId);
|
||||
const hasPaymentMethods = paymentMethods.length > 0;
|
||||
const subscriptionStatus = currentSubscription?.status || (hasActivePlan ? 'active' : 'none');
|
||||
const hasPendingManualPayment = payments.some((p) => p.status === 'pending_approval');
|
||||
|
||||
Reference in New Issue
Block a user