From eeed871583b9922b9e769bdecf5396126356e8f7 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Fri, 25 Jul 2025 13:51:54 +0530 Subject: [PATCH] Fix null token amount checking --- src/components/PaymentModal.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/PaymentModal.tsx b/src/components/PaymentModal.tsx index 03012d8..3d6b265 100644 --- a/src/components/PaymentModal.tsx +++ b/src/components/PaymentModal.tsx @@ -50,7 +50,7 @@ export default function PaymentModal({ // Fetch payment amount based on USD price for both payment methods useEffect(() => { - if (!isOpen || !deploymentCost || !paymentMethod) return; + if (!isOpen || deploymentCost === null || !paymentMethod) return; const fetchPaymentAmount = async () => { setLoadingPrice(true); @@ -86,7 +86,7 @@ export default function PaymentModal({ useEffect(() => { if (isOpen) { setError(''); - setTokenAmount(0); + setTokenAmount(-1); } }, [isOpen]); @@ -95,7 +95,7 @@ export default function PaymentModal({ return; } - if (tokenAmount === 0 || loadingPrice) { + if (tokenAmount === -1 || loadingPrice) { setError('Payment amount not ready. Please wait.'); return; }