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<
74
74
this . #connected = false
75
75
this . #connectIntervalId = null
76
76
this . #connectEveryMs = 500
77
-
78
- if ( typeof CustomEvent !== 'undefined' ) {
79
- this . #connectFunction( )
80
- this . startConnectLoop ( )
81
- }
82
77
}
83
78
84
79
private startConnectLoop ( ) {
@@ -188,11 +183,17 @@ export class EventClient<
188
183
// wait to connect to the bus
189
184
if ( ! this . #connected) {
190
185
this . debugLog ( 'Bus not available, will be pushed as soon as connected' )
191
- return this . #queuedEvents. push ( {
186
+ this . #queuedEvents. push ( {
192
187
type : `${ this . #pluginId} :${ eventSuffix } ` ,
193
188
payload,
194
189
pluginId : this . #pluginId,
195
190
} )
191
+ // start connection to event bus
192
+ if ( typeof CustomEvent !== 'undefined' ) {
193
+ this . #connectFunction( )
194
+ this . startConnectLoop ( )
195
+ }
196
+ return
196
197
}
197
198
// emit right now
198
199
return this . emitEventToBus ( {
You can’t perform that action at this time.
0 commit comments