Merge branch 'virtual-wallet-country-fix' of WrenchBoard/Users-Wrench into master
This commit is contained in:
@@ -15,9 +15,10 @@ export default function MarketPlace({ commonHeadData }) {
|
|||||||
const marketData = jobLists?.result_list;
|
const marketData = jobLists?.result_list;
|
||||||
const categories = jobLists?.categories;
|
const categories = jobLists?.categories;
|
||||||
const image_server = jobLists?.session_image_server;
|
const image_server = jobLists?.session_image_server;
|
||||||
|
console.log('Lenth', marketData?.length )
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(marketData?.length < 1 && !jobLists.loading){
|
if(!jobLists.loading && (marketData?.length < 1 || !marketData)){
|
||||||
dispatch(tableReload({ type: "MARKETTABLELIST" })); // reloads market page
|
dispatch(tableReload({ type: "MARKETTABLELIST" })); // reloads market page
|
||||||
}
|
}
|
||||||
},[])
|
},[])
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import WalletBox from "./WalletBox";
|
import WalletBox from "./WalletBox";
|
||||||
|
import { tableReload } from '../../store/TableReloads';
|
||||||
|
|
||||||
const WalletRoutes = () => {
|
const WalletRoutes = () => {
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||||
const { walletTable } = useSelector((state) => state.tableReload);
|
const { walletTable } = useSelector((state) => state.tableReload);
|
||||||
@@ -60,6 +63,12 @@ const WalletRoutes = () => {
|
|||||||
getPaymentHistory();
|
getPaymentHistory();
|
||||||
}, [walletTable]);
|
}, [walletTable]);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!walletDetails.loading && walletDetails?.data?.length < 1){
|
||||||
|
dispatch(tableReload({ type: "WALLETTABLE" })); // reloads wallet page
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<WalletBox
|
<WalletBox
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
|
|
||||||
const { userDetails } = useSelector((state) => state.userDetails);
|
const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
|
|
||||||
const countryCode = userDetails?.country
|
const countryCode = walletItem?.country
|
||||||
|
|
||||||
const userApi = new usersService()
|
const userApi = new usersService()
|
||||||
|
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
getMyJobList();
|
getMyJobList();
|
||||||
}, [jobListTable, isLogin.status]);
|
}, [jobListTable, isLogin.status]);
|
||||||
|
|
||||||
|
//FUNCTION TO GET FULL USER WALLETS
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user