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) {