1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-26 18:44:57 +02:00

Handle redirect on purchase

This commit is contained in:
Kamran Ahmed
2025-01-31 17:37:07 +00:00
parent 126501b40a
commit 201632941a

View File

@@ -75,6 +75,12 @@ export function BuyButton(props: BuyButtonProps) {
window.location.href = data.checkoutUrl; 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) => { onError: (error) => {
console.error(error); console.error(error);