socket context added
This commit is contained in:
@@ -8,10 +8,13 @@ import siteLinks from '../../links/siteLinks'
|
||||
|
||||
import debounceFunction from '../../utils/debounceFunction'
|
||||
import { accountDashboard } from '../../services/services';
|
||||
import { SocketContextValues } from '../context/SocketIOContext';
|
||||
|
||||
|
||||
export default function UserExist() {
|
||||
|
||||
const {joinRoom} = SocketContextValues() // Destructures values from socket context
|
||||
|
||||
const navigate = useNavigate()
|
||||
|
||||
const [loading, setLoading] = useState(true)
|
||||
@@ -89,6 +92,12 @@ export default function UserExist() {
|
||||
// return () => clearTimeout(timer)
|
||||
// },[])
|
||||
|
||||
useEffect(()=>{
|
||||
if(localStorage.getItem('room')){
|
||||
joinRoom(localStorage.getItem('room'))
|
||||
}
|
||||
},[])
|
||||
|
||||
return (
|
||||
<>
|
||||
{loading ?
|
||||
|
||||
Reference in New Issue
Block a user