initial commit

This commit is contained in:
victorAnumudu
2024-03-18 19:29:35 +01:00
parent c733b006fb
commit 9b12ffe0cd
2 changed files with 18 additions and 2 deletions
+6 -1
View File
@@ -32,7 +32,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
);
const {
userDetails: { username, uid, session, account_type },
userDetails: { username, uid, session, account_type, parent_uid },
} = 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
@@ -323,6 +323,11 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
joinRoom('full-markets-jobs')
},[isLogin.status])
useEffect(()=>{ // sends an event to the socket to enable user join a room to be able to receive update for parent child job assign
joinRoom(`FAMILY-${account_type == 'FULL' ? uid : parent_uid}`)
console.log(`Room joined for parent child task assign as ${account_type} with ${account_type == 'FULL' ? uid : parent_uid}}, => ${uid}, ${parent_uid}`)
},[isLogin.status])
// RENDER PAGE
return isLogin.loading && !loggedIn ? (