improvement: rejoin websocket channels after reconnecting

This commit is contained in:
canove
2021-01-10 11:07:10 -03:00
parent d374c84b60
commit 8ef50a76ca
7 changed files with 16 additions and 8 deletions

View File

@@ -86,7 +86,8 @@ const Ticket = () => {
useEffect(() => {
const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
socket.emit("joinChatBox", ticketId);
socket.on("connect", () => socket.emit("joinChatBox", ticketId));
socket.on("ticket", data => {
if (data.action === "updateStatus") {