From dfe5785afa13705fdfd00ab370a40a9501a0b2c8 Mon Sep 17 00:00:00 2001 From: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:59:55 +0530 Subject: [PATCH] Update ChatDataProvider.tsx --- packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx b/packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx index 552b5ee48..63d6bec82 100644 --- a/packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx +++ b/packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx @@ -319,9 +319,8 @@ export const ChatUIProvider = ({ // check and filter out the streams which are not connected const streamsToConnect = streams.filter((stream) => !connectedStreams.listen?.includes(stream)); - const uniqueStreams = [...new Set([...connectedStreams.listen, ...streams])]; if (streamsToConnect.length) { - await userInstance.stream?.reinit(uniqueStreams, { + await userInstance.stream?.reinit(streams, { connection: { retries: 3, // number of retries in case of error }, @@ -415,7 +414,7 @@ export const ChatUIProvider = ({ // setTimeout(async () => { // console.debug('UIWeb::ChatDataProvider::attachListenersAndConnect::Timeout Connect', userInstance?.stream?.uid); - if (!userInstance?.stream?.connected()) { + if (!userInstance.stream?.connected()) { console.debug('UIWeb::ChatDataProvider::attachListenersAndConnect::Stream not connected', userInstance); await userInstance.stream?.connect();