From 201632941ae48917db97a14355d5161a20f6f2b3 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 31 Jan 2025 17:37:07 +0000 Subject: [PATCH] Handle redirect on purchase --- src/components/SQLCourse/BuyButton.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/SQLCourse/BuyButton.tsx b/src/components/SQLCourse/BuyButton.tsx index 1a4f1b917..1876d11de 100644 --- a/src/components/SQLCourse/BuyButton.tsx +++ b/src/components/SQLCourse/BuyButton.tsx @@ -75,6 +75,12 @@ export function BuyButton(props: BuyButtonProps) { window.location.href = data.checkoutUrl; }, }); + + // Hacky way to make sure that we redirect in case + // GA was blocked or not able to redirect the user. + setTimeout(() => { + window.location.href = data.checkoutUrl; + }, 3000); }, onError: (error) => { console.error(error);