Compare commits

..

2 Commits

4 changed files with 7 additions and 35 deletions
+1 -1
View File
@@ -22,4 +22,4 @@ REACT_APP_SUPPORT_NG_ADDRESS='Saka Tinubu Street, Victoria Island Lagos, Nigeria
REACT_APP_AGENT_LINK='https://agents.wrenchboard.com' REACT_APP_AGENT_LINK='https://agents.wrenchboard.com'
#SOCKETS ENDS #SOCKETS ENDS
REACT_APP_PRIMARY_SOCKET="https://socket.wrenchboard.com" REACT_APP_PRIMARY_SOCKET="https://socket-dev.wrenchboard.com"
-1
View File
@@ -11,7 +11,6 @@ function App() {
useEffect(()=>{ // sends an event to the socket to enable user join a room to be able to receive update when jobs enters the market useEffect(()=>{ // sends an event to the socket to enable user join a room to be able to receive update when jobs enters the market
joinRoom('full-markets-jobs') joinRoom('full-markets-jobs')
console.log('market room joined')
},[]) },[])
return ( return (
-1
View File
@@ -25,7 +25,6 @@ export default function SocketIOContextProvider({children}) {
useEffect(() => { useEffect(() => {
socket.on("received_refreshmarket_jobs", (data) => { socket.on("received_refreshmarket_jobs", (data) => {
setSocketMsgReceived({type: 'market', msg: data?.message}); setSocketMsgReceived({type: 'market', msg: data?.message});
console.log('YES ssss')
}); });
}, [socket]); }, [socket]);
+6 -32
View File
@@ -18,21 +18,6 @@ let CurrentJobsHero = () => {
let [jobs, setJobs] = useState([]) let [jobs, setJobs] = useState([])
// constructor() {
// // debugger;
// super();
// this.state = { jobsDataResults: [] };
// }
// async componentDidMount(){
// // debugger;
// JobsData().then(res => {
// this.setState({jobsDataResults:res.data.result_list});
// }).catch(err => {
// console.log('startjoblist error', err)
// })
// }
function titleLen(title){ function titleLen(title){
let maxl = 45; let maxl = 45;
title.replace('/', ' '); title.replace('/', ' ');
@@ -44,24 +29,13 @@ let CurrentJobsHero = () => {
} }
useEffect(()=>{ useEffect(()=>{
if(socketMsgReceived.type == '' || socketMsgReceived.type == 'market'){ JobsData().then(res => {
JobsData().then(res => { setJobs(res.data.result_list);
setJobs(res.data.result_list); }).catch(err => {
}).catch(err => { console.log('startjoblist error', err)
console.log('startjoblist error', err) })
}) },[socketMsgReceived])
}
},[socketMsgReceived.type])
// if ( this.state.jobsDataResults== undefined ){
// return null;
// }
// if (this.state.jobsDataResults.length == 0){
// return <></>;
// }
return ( return (
<> <>
{jobs.length < 1 ? {jobs.length < 1 ?