Skip to content

Commit

Permalink
Update ChatDataProvider.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
mishramonalisha76 authored Nov 6, 2024
1 parent d5fd11c commit dfe5785
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit dfe5785

Please sign in to comment.