From 6ab04f488ab266e7a80a209a47806e4c83d68252 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 8 May 2025 11:47:57 -0500 Subject: [PATCH] No ios subs --- frontend/src/routes/pricing.tsx | 65 +++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/frontend/src/routes/pricing.tsx b/frontend/src/routes/pricing.tsx index 05b272523..3c58e5bff 100644 --- a/frontend/src/routes/pricing.tsx +++ b/frontend/src/routes/pricing.tsx @@ -256,6 +256,12 @@ function PricingPage() { const targetPlanName = product.name.toLowerCase(); const isTeamPlan = targetPlanName.includes("team"); + const isFreePlan = targetPlanName.includes("free"); + + // For iOS, show "Coming Soon" for all paid plans + if (isIOS && !isFreePlan) { + return "Coming Soon"; + } // Always show Contact Us for team plan when not logged in if (!isLoggedIn) { @@ -287,7 +293,7 @@ function PricingPage() { } // For free plan - if (targetPlanName.includes("free")) { + if (isFreePlan) { if (isCurrentPlan) { return "Start Chatting"; } @@ -422,17 +428,24 @@ function PricingPage() { const handleButtonClick = useCallback( (product: Product) => { - if (!isLoggedIn) { - const targetPlanName = product.name.toLowerCase(); - const isTeamPlan = targetPlanName.includes("team"); + const targetPlanName = product.name.toLowerCase(); + const isTeamPlan = targetPlanName.includes("team"); + const isFreePlan = targetPlanName.includes("free"); + // For iOS, disable subscription actions for paid plans + if (isIOS && !isFreePlan) { + // Do nothing for paid plans on iOS + return; + } + + if (!isLoggedIn) { // For team plan, redirect to email when not logged in if (isTeamPlan) { window.location.href = "mailto:support@opensecret.cloud"; return; } - if (!targetPlanName.includes("free")) { + if (!isFreePlan) { // For paid plans, redirect to signup with the plan selection navigate({ to: "/signup", @@ -447,9 +460,6 @@ function PricingPage() { return; } - const targetPlanName = product.name.toLowerCase(); - const isTeamPlan = targetPlanName.includes("team"); - // For team plan, ALWAYS redirect to email if not whitelisted // regardless of current subscription status if (isTeamPlan) { @@ -468,7 +478,7 @@ function PricingPage() { const currentPlanName = freshBillingStatus?.product_name?.toLowerCase(); const isCurrentlyOnFreePlan = currentPlanName?.includes("free"); - const isTargetFreePlan = targetPlanName.includes("free"); + const isTargetFreePlan = isFreePlan; // If on free plan and clicking free plan, go home if (isCurrentlyOnFreePlan && isTargetFreePlan) { @@ -507,11 +517,18 @@ function PricingPage() { useEffect(() => { let isSubscribed = true; - // If user is logged in and there's a selected plan, trigger checkout (except on iOS for paid plans) + // If user is logged in and there's a selected plan, trigger checkout if (isLoggedIn && selected_plan && !isBillingStatusLoading) { if (loadingProductId) return; // Prevent multiple triggers const product = products?.find((p) => p.id === selected_plan); + + // Skip checkout for paid plans on iOS if (product && isSubscribed) { + const isFreePlan = product.name.toLowerCase().includes("free"); + if (isIOS && !isFreePlan) { + // Don't trigger checkout for paid plans on iOS + return; + } handleButtonClick(product); } } @@ -537,9 +554,9 @@ function PricingPage() { + Simple, Transparent Pricing - + } subtitle={
@@ -611,9 +628,9 @@ function PricingPage() { + Simple, Transparent Pricing - + } subtitle={
@@ -646,6 +663,18 @@ function PricingPage() {
)} + {/* iOS Subscription Banner */} + {isIOS && ( +
+
+
+ +
+

Subscription purchases are not yet available in app.

+
+
+ )} + {!isIOS && (
@@ -778,7 +807,9 @@ function PricingPage() {