added banner to family dashboard banner list

This commit was merged in pull request #574.
This commit is contained in:
victorAnumudu
2024-02-25 21:16:38 +01:00
parent 2c6e36aea9
commit de477f32ed
2 changed files with 36 additions and 25 deletions
+25 -16
View File
@@ -25,11 +25,11 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
);
const {
userDetails: { username, uid, session },
userDetails: { username, uid, session, account_type },
} = 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,6 +166,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}, []);
useEffect(() => {
if(!account_type || !isLogin.status || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
return
}
const getMyJobList = async () => {
dispatch(updateUserJobList({ loading: true, data: [] }));
try {
@@ -180,7 +183,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}
};
getMyJobList();
}, [jobListTable]);
}, [jobListTable, isLogin.status]);
useEffect(() => {
const getMyWalletList = async () => {
@@ -200,6 +203,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}, [walletTable]);
useEffect(() => {
if(!account_type || !isLogin.status || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
return
}
// Getting market data
const getMarketActiveJobList = async () => {
try {
@@ -210,22 +216,25 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}
};
getMarketActiveJobList();
}, [apiCall, dispatch, jobListTable]);
}, [apiCall, dispatch, jobListTable, isLogin.status]);
//FUNCTION TO GET COMMON HEAD DATA
useEffect(() => {
apiCall
.getHeroJBanners()
.then((res) => {
if (res.data.internal_return < 0) {
return;
}
dispatch(commonHeadBanner(res.data));
})
.catch((error) => {
console.log("ERROR ", error);
});
}, []);
if(!account_type || !isLogin.status || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
return
}
apiCall
.getHeroJBanners()
.then((res) => {
if (res.data.internal_return < 0) {
return;
}
dispatch(commonHeadBanner(res.data));
})
.catch((error) => {
console.log("ERROR ", error);
});
}, [isLogin.status]);
//FUNCTION TO GET COMMON HEAD DATA
useEffect(() => {