From ac08b62ca29bcc6a64afde90bdd0ee759dced838 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, 18 Dec 2023 22:23:12 +0000 Subject: [PATCH] fix: fix build --- src/components/StripePage/index.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/components/StripePage/index.tsx b/src/components/StripePage/index.tsx index 73fc431..5ebc6f6 100644 --- a/src/components/StripePage/index.tsx +++ b/src/components/StripePage/index.tsx @@ -1,6 +1,6 @@ import { useApi } from "@/api"; import Loader from "@/components/Loader"; -import { useEffect, useRef, useState } from "react"; +import { useEffect, useState } from "react"; import { Stripe, loadStripe } from "@stripe/stripe-js"; import { Elements } from "@stripe/react-stripe-js"; import CheckoutForm from "../PaymentPage/methods/Stripe/CheckoutForm"; @@ -80,7 +80,7 @@ export function StripePage(): JSX.Element { // }, [api, token]); useEffect(() => { - timeoutRef.current = setTimeout(async () => { + (async () => { const { subscription_receipt } = await api.createSubscriptionReceipt({ token, way: "stripe", @@ -91,12 +91,7 @@ export function StripePage(): JSX.Element { const { client_secret } = subscription_receipt.data; setClientSecret(client_secret); setIsLoading(false); - }, 4000); - return () => { - if (timeoutRef.current) { - clearTimeout(timeoutRef.current); - } - }; + })(); }, [api, token]); return (