From 22e61d2b414b60da767bb297a51064aa01b16368 Mon Sep 17 00:00:00 2001 From: Ebube Date: Wed, 26 Jul 2023 15:49:04 +0100 Subject: [PATCH] Enforced send limit --- src/components/MyWallet/Popup/ConfirmNairaWithdraw.jsx | 8 ++++++++ src/components/MyWallet/Popup/NairaWithdraw.jsx | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/MyWallet/Popup/ConfirmNairaWithdraw.jsx b/src/components/MyWallet/Popup/ConfirmNairaWithdraw.jsx index 38c2849..6d84ced 100644 --- a/src/components/MyWallet/Popup/ConfirmNairaWithdraw.jsx +++ b/src/components/MyWallet/Popup/ConfirmNairaWithdraw.jsx @@ -263,6 +263,10 @@ function ConfirmNairaWithdraw({ ?.toLowerCase() .includes("limit") ? "Transfer limit Error" + : completeNairaWithdraw.state?.bad_param + ?.toLowerCase() + .includes("balance") + ? "Insufficient Balance" : "An Error Occurred"}{" "} @@ -283,6 +287,10 @@ function ConfirmNairaWithdraw({ ?.toLowerCase() .includes("limit") ? "The transfer limit has been exceeded" + : completeNairaWithdraw.state?.bad_param + ?.toLowerCase() + .includes("balance") + ? "Insufficient Balance for Transaction" : "Could not perform transaction"} diff --git a/src/components/MyWallet/Popup/NairaWithdraw.jsx b/src/components/MyWallet/Popup/NairaWithdraw.jsx index 2d156f3..70a2ed9 100644 --- a/src/components/MyWallet/Popup/NairaWithdraw.jsx +++ b/src/components/MyWallet/Popup/NairaWithdraw.jsx @@ -171,8 +171,8 @@ function NairaWithdraw({ setErrorMsgs({ amount: "amount required" }); setTimeout(() => setErrorMsgs({ amount: "" }), 3000); return; - } else if (Number(values.amount) > Number(wallet?.transfer_limit)) { - setErrorMsgs({ amount: "transfer limit exceeded" }); + }else if (Number(values.amount * 100) > Number(wallet?.transfer_limit)) { + setErrorMsgs({ amount: "Withdraw limit has been exceeded" }); setTimeout(() => setErrorMsgs({ amount: "" }), 3000); return; } @@ -326,8 +326,8 @@ function NairaWithdraw({