Skip to content

Commit

Permalink
fix: fixed stream
Browse files Browse the repository at this point in the history
  • Loading branch information
mishramonalisha76 committed Nov 6, 2024
2 parents 0151607 + 7f6dd8c commit f05c7e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 3 additions & 0 deletions packages/restapi/src/lib/pushstream/PushStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export class PushStream extends EventEmitter {

if (this.pushChatSocket) {
console.log('RestAPI::PushStream::s-1');
checkAndEmitConnectEvent();
this.pushChatSocket.off(EVENTS.CONNECT);
this.pushChatSocket.on(EVENTS.CONNECT, async () => {
console.log('RestAPI::PushStream::s-2');
Expand Down Expand Up @@ -506,6 +507,8 @@ export class PushStream extends EventEmitter {
}

if (this.pushNotificationSocket) {
checkAndEmitConnectEvent();
console.log('RestAPI::PushStream::s-4.9');
this.pushNotificationSocket.off(EVENTS.CONNECT);
this.pushNotificationSocket.on(EVENTS.CONNECT, async () => {
console.log('RestAPI::PushStream::s-5');
Expand Down
9 changes: 0 additions & 9 deletions packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,6 @@ 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])];
console.debug(
userInstance,
userInstance?.uid,
userInstance.stream?.uid,
streamsToConnect,
uniqueStreams,
'uniqueStreams1'
);
if (streamsToConnect.length) {
await userInstance.stream?.reinit(uniqueStreams, {
connection: {
Expand All @@ -338,7 +330,6 @@ export const ChatUIProvider = ({
// reinit
status = 2;
}
console.debug(userInstance, userInstance?.uid, userInstance.stream?.uid, 'uniqueStreams2');
}

// attach listeners and connect if status is changed
Expand Down

0 comments on commit f05c7e6

Please sign in to comment.