balance refresh bug for withdraw

This commit is contained in:
2023-07-27 16:28:21 +01:00
parent 98f11a3d80
commit 84968b4435
3 changed files with 5 additions and 29 deletions
@@ -1,9 +1,10 @@
import { useState } from "react";
import { useNavigate } from "react-router-dom";
import usersService from "../../../services/UsersService";
import InputCom from "../../Helpers/Inputs/InputCom";
import ModalCom from "../../Helpers/ModalCom";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import { useDispatch } from "react-redux";
import { tableReload } from "../../../store/TableReloads";
function ConfirmNairaWithdraw({
payment,
@@ -14,7 +15,7 @@ function ConfirmNairaWithdraw({
setShowNairaWithdraw,
}) {
const apiURL = new usersService();
const navigate = useNavigate();
const dispatch = useDispatch();
let [requestStatus, setRequestStatus] = useState({
message: "",
@@ -90,6 +91,7 @@ function ConfirmNairaWithdraw({
state: res.data,
});
}, 5000);
dispatch(tableReload({ type: "WALLETTABLE" }));
return;
})
.catch((error) => {
@@ -101,11 +103,6 @@ function ConfirmNairaWithdraw({
});
};
// const completeWithdrawal = () => {
// action();
// window.location.reload(true);
// };
return (
<ModalCom action={action} situation={situation} className="edit-popup">
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
-3
View File
@@ -67,9 +67,6 @@ const WalletRoutes = () => {
getPaymentHistory()
}, [walletTable]);
console.log('TESTING',walletTable);
return (
<Layout>
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
+1 -19
View File
@@ -8,30 +8,12 @@ function WalletAction({ walletItem, payment, openPopUp }) {
show: false,
state: {},
}); // DETERMINES WHEN NAIRA WITHDRAWAL POPS UP
const [countries, setCountries] = useState([]);
const [showConfirmNairaWithdraw, setShowConfirmNairaWithdraw] = useState({
show: false,
state: {},
}); // DETERMINES WHEN CONFIRM NAIRA WITHDRAWAL POPS UP
const userApi = new usersService();
// Get Country Api
const getCountryList = useCallback(async () => {
const res = await userApi.getSignupCountryData();
try {
if (res.status === 200) {
const { signup_country } = await res.data;
setCountries(signup_country);
} else if (res.data.result !== 100) {
setCountries("Nothing see here!");
}
} catch (error) {
throw new Error(error);
}
}, []);
return (
<div className="counters w-full flex justify-between gap-2">
<div className="w-1/2 flex justify-center items-center">