From 230d74fef093cbcbee4ed7ed7559a3f142dffd81 Mon Sep 17 00:00:00 2001 From: harshitk99 Date: Sun, 31 Aug 2025 02:51:33 +0530 Subject: [PATCH] redirection after premium payment --- frontend/components/RazorpayPayment.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/components/RazorpayPayment.tsx b/frontend/components/RazorpayPayment.tsx index 4fc3cb64..db5e20f9 100644 --- a/frontend/components/RazorpayPayment.tsx +++ b/frontend/components/RazorpayPayment.tsx @@ -114,8 +114,10 @@ const RazorpayPayment: React.FC = ({ toast.success(response2.data.message || "Payment successful! Your yearly plan is now active!", { duration: 5000 }); - // Refresh user credits - window.location.reload(); + // Redirect to chat page after successful payment + setTimeout(() => { + router.push("/ask"); + }, 2000); } else { toast.error("Payment failed! Please try again."); } @@ -178,8 +180,10 @@ const RazorpayPayment: React.FC = ({ toast.success("Payment successful! Your subscription is being activated...", { duration: 3000 }); - // Refresh user credits - window.location.reload(); + // Redirect to chat page after successful payment + setTimeout(() => { + router.push("/ask"); + }, 2000); } else { toast.error("Payment failed! Please try again."); }