Fix null token amount checking
This commit is contained in:
parent
aae48cdef4
commit
eeed871583
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user