@@ -47,6 +47,7 @@ export class Launcher extends Observable implements DefaultLauncher {
4747 localParticipant . publish ( { ...participant } ) ;
4848 participants . subscribe ( this . onParticipantListUpdate ) ;
4949 isDomainWhitelisted . subscribe ( this . onAuthentication ) ;
50+ localParticipant . subscribe ( this . onLocalParticipantUpdate ) ;
5051
5152 group . publish ( participantGroup ) ;
5253 this . ioc = new IOC ( localParticipant . value ) ;
@@ -188,11 +189,9 @@ export class Launcher extends Observable implements DefaultLauncher {
188189 * @returns {boolean }
189190 */
190191 private canAddComponent = ( component : Partial < BaseComponent > ) : boolean => {
191- const { localParticipant } = useStore ( StoreType . GLOBAL ) ;
192-
193192 const isProvidedFeature = config . get < boolean > ( `features.${ component . name } ` ) ;
194193 const hasComponentLimit = LimitsService . checkComponentLimit ( component . name ) ;
195- const isComponentActive = localParticipant . value . activeComponents ?. includes ( component . name ) ;
194+ const isComponentActive = this . activeComponents ?. includes ( component . name ) ;
196195
197196 const verifications = [
198197 {
@@ -236,6 +235,16 @@ export class Launcher extends Observable implements DefaultLauncher {
236235 ) ;
237236 } ;
238237
238+ private onLocalParticipantUpdate = ( participant : Participant ) : void => {
239+ this . activeComponents = participant . activeComponents || [ ] ;
240+
241+ if ( this . activeComponents . length ) {
242+ this . activeComponentsInstances = this . activeComponentsInstances . filter ( ( ac ) => {
243+ return this . activeComponents . includes ( ac . name ) ;
244+ } ) ;
245+ }
246+ } ;
247+
239248 /**
240249 * @function onParticipantListUpdate
241250 * @description on participant list update
0 commit comments