diff --git a/src/components/Home/FamilyDash.jsx b/src/components/Home/FamilyDash.jsx index 062ebd7..a6b11c1 100644 --- a/src/components/Home/FamilyDash.jsx +++ b/src/components/Home/FamilyDash.jsx @@ -40,7 +40,7 @@ export default function FamilyDash({ familyOffers, MyActiveJobList }) { <> {!familyBannersList.loading && familyBannersList?.result?.result_list && Object.keys(familyBannersList?.result?.result_list).length > 0 && // Loop for Family Banners -
+
{Object.keys(familyBannersList?.result?.result_list).map((item, index) => { let content = familyBannersList?.result?.result_list[item] return ( diff --git a/src/middleware/AuthRoute.jsx b/src/middleware/AuthRoute.jsx index 73d1f08..c8935c2 100644 --- a/src/middleware/AuthRoute.jsx +++ b/src/middleware/AuthRoute.jsx @@ -29,7 +29,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => { } = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active let loggedIn = username && session && uid ? true : false; // variable to determine if user is logged in -console.log('USER', account_type) + useEffect(() => { //Removing Data stored at localStorage after session expires const expireSession = () => { @@ -166,7 +166,7 @@ console.log('USER', account_type) }, []); useEffect(() => { - if(!account_type || !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 } const getMyJobList = async () => { @@ -203,7 +203,7 @@ console.log('USER', account_type) }, [walletTable]); useEffect(() => { - if(!account_type || !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 } // Getting market data @@ -220,7 +220,7 @@ console.log('USER', account_type) //FUNCTION TO GET COMMON HEAD DATA useEffect(() => { - if(!account_type || !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 } apiCall