We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfae8df commit 9d56b5fCopy full SHA for 9d56b5f
1 file changed
src/stomp-handler.ts
@@ -195,7 +195,7 @@ export class StompHandler {
195
this.onWebSocketError(errorEvent);
196
};
197
198
- this._webSocket.onopen = () => {
+ const onOpen = () => {
199
// Clone before updating
200
const connectHeaders = (Object as any).assign({}, this.connectHeaders);
201
@@ -207,6 +207,12 @@ export class StompHandler {
207
].join(',');
208
this._transmit({ command: 'CONNECT', headers: connectHeaders });
209
210
+
211
+ if (this._webSocket.readyState === StompSocketState.OPEN) {
212
+ onOpen();
213
+ } else {
214
+ this._webSocket.onopen = onOpen;
215
+ }
216
}
217
218
private readonly _serverFrameHandlers: {
0 commit comments