diff --git a/src/core/launcher/index.ts b/src/core/launcher/index.ts index 1f063cbd..1c12618c 100644 --- a/src/core/launcher/index.ts +++ b/src/core/launcher/index.ts @@ -240,6 +240,16 @@ export class Launcher extends Observable implements DefaultLauncher { ); }; + private onLocalParticipantUpdate = (participant: Participant): void => { + this.activeComponents = participant.activeComponents || []; + + if (this.activeComponents.length) { + this.activeComponentsInstances = this.activeComponentsInstances.filter((ac) => { + return this.activeComponents.includes(ac.name); + }); + } + }; + /** * @function onLocalParticipantUpdateOnStore * @description handles the update of the local participant in the store. diff --git a/src/services/io/index.ts b/src/services/io/index.ts index a5a5282d..ba5ce4b3 100644 --- a/src/services/io/index.ts +++ b/src/services/io/index.ts @@ -23,7 +23,6 @@ export class IOC { */ public destroy(): void { this.client.destroy(); - this.client.connection.off(); } /** @@ -43,7 +42,7 @@ export class IOC { if ( needsToReconnectStates.includes(state.state) && - state.reason !== 'Unauthorized connection' + !['io client disconnect', 'Unauthorized connection'].includes(state.reason) ) { this.forceReconnect(); }