From 9906a242459fdaf7c02da2d27bf5ed61a7038815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B5=D0=BD=D0=B8=D1=81=20=D0=9A=D0=B0=D1=82=D0=B0?= =?UTF-8?q?=D0=B5=D0=B2?= Date: Thu, 26 Dec 2024 22:06:18 +0000 Subject: [PATCH] hotfix/change-home-page-protection --- src/components/App/index.tsx | 2 +- .../PalmistryV1/pages/Payment/index.tsx | 31 +------------------ .../v1/CheckSubscriptionOutlet/index.tsx | 1 + 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index 4206ae4..8d4bbd6 100755 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -1275,7 +1275,7 @@ export function PrivateOutlet(): JSX.Element { function PrivateSubscriptionOutlet(): JSX.Element { const isProduction = import.meta.env.MODE === "production"; const status = useSelector(selectors.selectStatus); - return status === "subscribed" || !isProduction ? ( + return status === "subscribed" || !isProduction || true ? ( ) : ( diff --git a/src/components/PalmistryV1/pages/Payment/index.tsx b/src/components/PalmistryV1/pages/Payment/index.tsx index da9c9f8..31180ff 100644 --- a/src/components/PalmistryV1/pages/Payment/index.tsx +++ b/src/components/PalmistryV1/pages/Payment/index.tsx @@ -5,21 +5,13 @@ import { actions, selectors } from "@/store"; import { getFormattedPrice } from "@/utils/price.utils"; import Guarantees from "../../components/Guarantees"; import Button from "../../components/Button"; -import { useEffect } from "react"; -import { useNavigate, useSearchParams } from "react-router-dom"; -import routes from "@/routes"; import { addCurrency, ELocalesPlacement } from "@/locales"; import { useTranslations } from "@/hooks/translations"; import Stars from "../../components/Stars"; -import metricService, { - EGoals, - EMetrics, -} from "@/services/metric/metricService"; function Payment() { const dispatch = useDispatch(); const { translate } = useTranslations(ELocalesPlacement.PalmistryV1); - const navigate = useNavigate(); const activeProductFromStore = useSelector(selectors.selectActiveProduct); const currency = useSelector(selectors.selectCurrency); const trialPrice = activeProductFromStore?.trialPrice || 0; @@ -27,32 +19,11 @@ function Payment() { const isShowPaymentModal = useSelector( selectors.selectPalmistryIsShowPaymentModalV1 ); - const [searchParams] = useSearchParams(); - const subscriptionStatus = - searchParams.get("redirect_status") === "succeeded" ? "subscribed" : "lead"; const showModal = () => { dispatch(actions.palmistry.setIsShowPaymentModalV1(true)); }; - useEffect(() => { - if (subscriptionStatus !== "subscribed") return; - metricService.reachGoal(EGoals.PAYMENT_SUCCESS); - metricService.reachGoal(EGoals.PAYMENT_SUCCESS_PALMISTRY, [ - EMetrics.YANDEX, - ]); - if (activeProductFromStore) { - metricService.reachGoal(EGoals.PURCHASE, [EMetrics.FACEBOOK], { - currency: "USD", - value: ((activeProductFromStore.trialPrice || 100) / 100).toFixed(2), - }); - } - const timer = setTimeout(() => { - navigate(routes.client.skipTrial()); - }, 1500); - return () => clearTimeout(timer); - }, [activeProductFromStore, navigate, subscriptionStatus]); - return ( <>
@@ -91,7 +62,7 @@ function Payment() { })}
- {!isShowPaymentModal && subscriptionStatus !== "subscribed" && ( + {!isShowPaymentModal && ( diff --git a/src/routerComponents/Palmistry/v1/CheckSubscriptionOutlet/index.tsx b/src/routerComponents/Palmistry/v1/CheckSubscriptionOutlet/index.tsx index 8fdcd5c..a8f1b30 100644 --- a/src/routerComponents/Palmistry/v1/CheckSubscriptionOutlet/index.tsx +++ b/src/routerComponents/Palmistry/v1/CheckSubscriptionOutlet/index.tsx @@ -17,6 +17,7 @@ function CheckSubscriptionOutlet({ const { user } = useAuth(); if (user && status === "subscribed") { + return ; return ; } if (unsubscribedReturnUrl?.length) {