File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
packages/event-bus-client/src Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,6 @@ export class EventClient<
7474 this . #connected = false
7575 this . #connectIntervalId = null
7676 this . #connectEveryMs = 500
77-
78- if ( typeof CustomEvent !== 'undefined' ) {
79- this . #connectFunction( )
80- this . startConnectLoop ( )
81- }
8277 }
8378
8479 private startConnectLoop ( ) {
@@ -188,11 +183,17 @@ export class EventClient<
188183 // wait to connect to the bus
189184 if ( ! this . #connected) {
190185 this . debugLog ( 'Bus not available, will be pushed as soon as connected' )
191- return this . #queuedEvents. push ( {
186+ this . #queuedEvents. push ( {
192187 type : `${ this . #pluginId} :${ eventSuffix } ` ,
193188 payload,
194189 pluginId : this . #pluginId,
195190 } )
191+ // start connection to event bus
192+ if ( typeof CustomEvent !== 'undefined' ) {
193+ this . #connectFunction( )
194+ this . startConnectLoop ( )
195+ }
196+ return
196197 }
197198 // emit right now
198199 return this . emitEventToBus ( {
You can’t perform that action at this time.
0 commit comments