From 91cb7d93a427035a599a9cb197d85f15088b5387 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Tue, 13 May 2025 10:58:51 +0100 Subject: [PATCH] fix(api): apply feedback --- api/src/websocket/websocket.gateway.ts | 3 ++- widget/src/providers/ChatProvider.tsx | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/api/src/websocket/websocket.gateway.ts b/api/src/websocket/websocket.gateway.ts index 3cd99fe9..d1cf5af6 100644 --- a/api/src/websocket/websocket.gateway.ts +++ b/api/src/websocket/websocket.gateway.ts @@ -435,8 +435,9 @@ export class WebsocketGateway if (!sessionId) { throw new Error('SessionId is required!'); } + const allSockets = await this.io.fetchSockets(); - return (await this.io.fetchSockets()).filter( + return allSockets.filter( ({ handshake, data }) => !handshake.query.channel && data.sessionID === sessionId, ); diff --git a/widget/src/providers/ChatProvider.tsx b/widget/src/providers/ChatProvider.tsx index ce4bb9e3..358736b7 100644 --- a/widget/src/providers/ChatProvider.tsx +++ b/widget/src/providers/ChatProvider.tsx @@ -327,9 +327,7 @@ const ChatProvider: React.FC<{ ); const quickReplies = getQuickReplies(body.messages.at(-1)); - if (quickReplies.length) { - setSuggestions(quickReplies); - } + setSuggestions(quickReplies); localStorage.setItem("profile", JSON.stringify(body.profile)); setMessages(