From 6fbba9ba99b47649ffa7c73b6dc37ed1890ddf9b 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: Mon, 8 Jul 2024 16:30:59 +0000 Subject: [PATCH] hotfix-fix-trialDuration --- src/components/PaymentModal/index.tsx | 2 +- src/components/pages/ABDesign/v1/pages/TrialChoice/index.tsx | 4 ++-- .../v1/pages/TrialPayment/components/PaymentTable/index.tsx | 2 +- src/hooks/authentication/use-authentication.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/PaymentModal/index.tsx b/src/components/PaymentModal/index.tsx index fe120cd..f60246e 100644 --- a/src/components/PaymentModal/index.tsx +++ b/src/components/PaymentModal/index.tsx @@ -151,7 +151,7 @@ function PaymentModal({ You will be charged only{" "} ${getPrice(_activeProduct)} for your{" "} - {_activeProduct.trialDuration}-day trial. + {_activeProduct?.trialDuration}-day trial.

diff --git a/src/components/pages/ABDesign/v1/pages/TrialChoice/index.tsx b/src/components/pages/ABDesign/v1/pages/TrialChoice/index.tsx index 1ea4ce6..c217897 100644 --- a/src/components/pages/ABDesign/v1/pages/TrialChoice/index.tsx +++ b/src/components/pages/ABDesign/v1/pages/TrialChoice/index.tsx @@ -108,8 +108,8 @@ function TrialChoicePage() { replacement: { target: "${trialDuration}", replacement: - activeProduct?.trialDuration.toString() || - products[0].trialDuration.toString() || + activeProduct?.trialDuration?.toString() || + products[0]?.trialDuration?.toString() || "3", }, })} diff --git a/src/components/pages/ABDesign/v1/pages/TrialPayment/components/PaymentTable/index.tsx b/src/components/pages/ABDesign/v1/pages/TrialPayment/components/PaymentTable/index.tsx index 8859b89..a51242d 100644 --- a/src/components/pages/ABDesign/v1/pages/TrialPayment/components/PaymentTable/index.tsx +++ b/src/components/pages/ABDesign/v1/pages/TrialPayment/components/PaymentTable/index.tsx @@ -87,7 +87,7 @@ function PaymentTable({

You are enrolling in 2 weeks subscription. By continuing you agree that - if you don't cancel prior to the end of the {product.trialDuration}-day + if you don't cancel prior to the end of the {product?.trialDuration}-day trial for the ${getPrice(product)} you will automatically be charged $ {product.price / 100}{" "} every 2 weeks until you cancel in settings. Learn more about diff --git a/src/hooks/authentication/use-authentication.ts b/src/hooks/authentication/use-authentication.ts index 0cbeb7a..7dc462e 100644 --- a/src/hooks/authentication/use-authentication.ts +++ b/src/hooks/authentication/use-authentication.ts @@ -67,7 +67,7 @@ export const useAuthentication = () => { }, [partnerBirthdateFromForm, partnerBirthdateFromQuestionnaire, partnerBirthtime]) const formatDate = useCallback((date: string) => { - const _date = moment(date).format("YYYY-MM-DD HH:mm"); + const _date = moment(new Date(date)).format("YYYY-MM-DD HH:mm"); if (_date === "Invalid date") { return null; }