messenger don't create new websocket if connecting
This commit is contained in:
parent
fc66d0d8cc
commit
03da423e5a
1 changed files with 3 additions and 1 deletions
|
|
@ -108,7 +108,9 @@ export class WebsocketMessenger extends Messenger {
|
|||
if (this.websocket.readyState === this.websocket.OPEN) {
|
||||
this.websocket.send(payload);
|
||||
} else {
|
||||
this.websocket = this._newWebsocket();
|
||||
if (this.websocket.readyState !== this.websocket.CONNECTING) {
|
||||
this.websocket = this._newWebsocket();
|
||||
}
|
||||
|
||||
this.websocket.addEventListener("open", () => {
|
||||
this.websocket.send(payload);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue