From 37257eda4a696393eaff7519030c9f5b1996b828 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 18 Oct 2025 15:47:28 -0500 Subject: [PATCH] Refactor subscription logic to determine paid plan based on plan name This commit updates the logic for identifying whether a subscription is a paid plan by checking the plan name instead of the plan price. The change enhances clarity by directly associating the plan type with its name, improving the maintainability of the subscription logic. --- app/store/hooks/useSubscriptionLogic.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/store/hooks/useSubscriptionLogic.ts b/app/store/hooks/useSubscriptionLogic.ts index 04308fcf..2e5a092c 100644 --- a/app/store/hooks/useSubscriptionLogic.ts +++ b/app/store/hooks/useSubscriptionLogic.ts @@ -61,10 +61,10 @@ export function useSubscriptionLogic(userId?: string): UseSubscriptionLogicResul return hasValidSubscriptionId; }, [subscription]); - // Determinar si es plan pagado basado en el precio del plan + // Determinar si es plan pagado basado en el nombre del plan const isPaidPlan = useMemo(() => { - if (!subscription) return false; - return (subscription.planPrice ?? 0) > 0; + if (!subscription || !subscription.planName) return false; + return subscription.planName !== 'free'; }, [subscription]); // Obtener el plan actual