fix: fix build
This commit is contained in:
parent
818aa2341e
commit
ac08b62ca2
@ -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 (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user