From fade7070ff1cd9fc318fee3cd7cc99f71401921a Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Wed, 29 Jan 2025 08:48:51 +0100 Subject: [PATCH] fix: apply feedback updates --- widget/src/providers/ChatProvider.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/widget/src/providers/ChatProvider.tsx b/widget/src/providers/ChatProvider.tsx index 0bd20df8..f907c428 100644 --- a/widget/src/providers/ChatProvider.tsx +++ b/widget/src/providers/ChatProvider.tsx @@ -453,8 +453,10 @@ const ChatProvider: React.FC<{ handleSubscription, }; - useBroadcastChannel("session", () => { - socketCtx.socket.disconnect(); + useBroadcastChannel("session", (e) => { + if (e.data === "logout") { + socketCtx.socket.disconnect(); + } }); return (