From a08d8feb7d68937ed9758ea12cf98b0a0726decb Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Mon, 13 Nov 2023 16:35:54 +0100 Subject: [PATCH 1/2] made wallet to reload when parent confirms task completion --- src/components/MyActiveJobs/JobActions/ReviewJobAction.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/MyActiveJobs/JobActions/ReviewJobAction.jsx b/src/components/MyActiveJobs/JobActions/ReviewJobAction.jsx index 6f808ff..2019474 100644 --- a/src/components/MyActiveJobs/JobActions/ReviewJobAction.jsx +++ b/src/components/MyActiveJobs/JobActions/ReviewJobAction.jsx @@ -3,9 +3,12 @@ import ModalCom from '../../Helpers/ModalCom' import LoadingSpinner from '../../Spinners/LoadingSpinner' import { useNavigate } from 'react-router-dom' import usersService from '../../../services/UsersService' +import { useDispatch } from 'react-redux' +import { tableReload } from '../../../store/TableReloads' function ReviewJobAction({jobDetails}) { + const dispatch = useDispatch() const apiCall = new usersService() const navigate = useNavigate() @@ -48,6 +51,7 @@ function ReviewJobAction({jobDetails}) { return } setReqStatus({loading:false, status: true, message: 'job completion accepted successfully'}) + dispatch(tableReload({ type: "WALLETTABLE" })); setTimeout(()=>{ // Sets popout to false and navigates user to /my-review-jobs after 3 seconds popUpHandler() navigate('/my-review-jobs', {replace: true}) From d3e2cc6744db22a80cd848c2c0801bdaa2e0222d Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Mon, 13 Nov 2023 19:38:29 +0100 Subject: [PATCH 2/2] added wallet reload when user accepts interest offer --- src/components/OffersInterest/ManageInterestOffer.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/OffersInterest/ManageInterestOffer.jsx b/src/components/OffersInterest/ManageInterestOffer.jsx index 7cac2f1..375af91 100644 --- a/src/components/OffersInterest/ManageInterestOffer.jsx +++ b/src/components/OffersInterest/ManageInterestOffer.jsx @@ -6,8 +6,11 @@ import CommonHead from "../UserHeader/CommonHead"; import usersService from "../../services/UsersService"; import LoadingSpinner from "../Spinners/LoadingSpinner"; import OthersInterestedTable from "./OthersInterestedTable"; +import { useDispatch } from "react-redux"; +import { tableReload } from "../../store/TableReloads"; export default function ManageInterestOffer(props) { + const dispatch = useDispatch() const navigate = useNavigate() const apiCall = new usersService() @@ -89,6 +92,7 @@ export default function ManageInterestOffer(props) { setRedirectTime(prev => prev - 1) }, 1000); setRequestStatus({loading: false, status: true, message: `Offer ${name}ed`, processType: ''}) + dispatch(tableReload({ type: "WALLETTABLE" })); setTimeout(()=>{ navigate('/offer-interest', {replace: true}) clearInterval(intervalTime)