change structure socket and add permission
This commit is contained in:
@@ -92,6 +92,16 @@ export const SocketProvider = ({ children }) => {
|
||||
}
|
||||
}, [status]);
|
||||
|
||||
useEffect(() => {
|
||||
if (status == "connected") return;
|
||||
|
||||
socket.connect();
|
||||
|
||||
return () => {
|
||||
socket.disconnect();
|
||||
};
|
||||
}, [socket]);
|
||||
|
||||
const contextValue = useMemo(() => ({ socket, status }), [socket, status]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user