fix: websocket handlers

This commit is contained in:
canove
2020-08-10 19:24:15 -03:00
parent 1c0e251b24
commit c7c451d227
4 changed files with 16 additions and 9 deletions

View File

@@ -221,7 +221,7 @@ const useStyles = makeStyles(theme => ({
},
}));
const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
let socket;
const MessagesList = () => {
const { ticketId } = useParams();
@@ -272,6 +272,7 @@ const MessagesList = () => {
}, [pageNumber, ticketId, history]);
useEffect(() => {
socket = openSocket(process.env.REACT_APP_BACKEND_URL);
socket.emit("joinChatBox", ticketId, () => {});
return () => {