From de237ec6fc93e25dad0b2d2b763a14eb89fcf535 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Thu, 17 Apr 2025 09:21:06 +0100 Subject: [PATCH] Keep button loading when redirecting --- src/components/SQLCourse/BuyButton.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/SQLCourse/BuyButton.tsx b/src/components/SQLCourse/BuyButton.tsx index 9112319d8..1b5a681c1 100644 --- a/src/components/SQLCourse/BuyButton.tsx +++ b/src/components/SQLCourse/BuyButton.tsx @@ -56,6 +56,7 @@ export function BuyButton(props: BuyButtonProps) { const { mutate: createCheckoutSession, isPending: isCreatingCheckoutSession, + isSuccess: isCheckoutSessionCreated, } = useMutation( { mutationFn: (body: CreateCheckoutSessionBody) => { @@ -147,6 +148,7 @@ export function BuyButton(props: BuyButtonProps) { const isLoadingPricing = isFakeLoading || + isCheckoutSessionCreated || isLoadingPrice || !coursePricing || isLoadingCourseProgress ||