From b17b6166f052d78d691ff57b52a09d0c272ee36a Mon Sep 17 00:00:00 2001 From: pyschonoice Date: Thu, 28 Aug 2025 18:53:17 +0530 Subject: [PATCH] fix redirection issue and clean up ui --- frontend/app/(app)/pricing/page.tsx | 14 +++++++++----- frontend/components/RazorpayPayment.tsx | 4 +++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/app/(app)/pricing/page.tsx b/frontend/app/(app)/pricing/page.tsx index 219fd2f3..7df62a88 100644 --- a/frontend/app/(app)/pricing/page.tsx +++ b/frontend/app/(app)/pricing/page.tsx @@ -92,7 +92,8 @@ export default function PricingPage() { {pricingPlans.map((plan) => ( - + + +
{plan.features.map((feature, index) => (
@@ -151,7 +154,7 @@ export default function PricingPage() {
))}
- + ); -} +} \ No newline at end of file diff --git a/frontend/components/RazorpayPayment.tsx b/frontend/components/RazorpayPayment.tsx index 38f65474..9533c47d 100644 --- a/frontend/components/RazorpayPayment.tsx +++ b/frontend/components/RazorpayPayment.tsx @@ -32,7 +32,7 @@ const RazorpayPayment: React.FC = ({ const { error, isLoading: rzpLoading, Razorpay } = useRazorpay(); const [isProcessing, setIsProcessing] = useState(false); const { user, isLoading: userLoading } = useUser(); - const { userCredits } = useCredits(); + const { userCredits, refetchCredits } = useCredits(); const router = useRouter(); const handlePayment = async () => { @@ -108,6 +108,8 @@ const RazorpayPayment: React.FC = ({ toast.success("Payment successful! Your subscription is being activated...", { duration: 3000 }); + await refetchCredits(); + router.replace("/ask"); } else { toast.error("Payment failed! Please try again."); }