diff --git a/packages/restapi/src/lib/pushstream/PushStream.ts b/packages/restapi/src/lib/pushstream/PushStream.ts index 92cb54eb4..8a7012301 100644 --- a/packages/restapi/src/lib/pushstream/PushStream.ts +++ b/packages/restapi/src/lib/pushstream/PushStream.ts @@ -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'); @@ -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'); diff --git a/packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx b/packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx index b3c785b61..552b5ee48 100644 --- a/packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx +++ b/packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx @@ -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: { @@ -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