feature/IO-3096-GlobalNotifications - Checkpoint, socket to email to bodyshop mapping.

This commit is contained in:
Dave Richer
2025-02-18 11:02:46 -05:00
parent a15f86cc4e
commit c02c36c548
4 changed files with 123 additions and 128 deletions

View File

@@ -17,7 +17,7 @@ const useSocket = (bodyshop) => {
const socketInstance = SocketIO(endpoint, {
path: "/wss",
withCredentials: true,
auth: { token },
auth: { token, bodyshopId: bodyshop.id },
reconnectionAttempts: Infinity,
reconnectionDelay: 2000,
reconnectionDelayMax: 10000
@@ -95,7 +95,7 @@ const useSocket = (bodyshop) => {
if (socketRef.current) {
// Update token if socket exists
socketRef.current.emit("update-token", token);
socketRef.current.emit("update-token", { token, bodyshopId: bodyshop.id });
} else {
// Initialize socket if not already connected
initializeSocket(token);