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

@@ -77,7 +77,7 @@ const NotificationsPopOver = () => {
useEffect(() => {
const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
socket.emit("joinNotification");
socket.on("connect", () => socket.emit("joinNotification"));
socket.on("ticket", data => {
if (data.action === "updateUnread" || data.action === "delete") {