larasopp 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Core.js CHANGED
@@ -141,12 +141,12 @@ class Core {
141
141
  this.ws.send(JSON.stringify(message));
142
142
  }
143
143
  send(message) {
144
- var _a;
144
+ var _a, _b;
145
145
  if (this.status) {
146
146
  this._send(message);
147
147
  }
148
148
  else {
149
- if (!((_a = this.ws) === null || _a === void 0 ? void 0 : _a.CONNECTING))
149
+ if (((_a = this.ws) === null || _a === void 0 ? void 0 : _a.readyState) !== ((_b = this.ws) === null || _b === void 0 ? void 0 : _b.CONNECTING))
150
150
  this.connect();
151
151
  const event = this.events.addListener('open', () => {
152
152
  this._send(message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larasopp",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Websocket client for laravel",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/Core.ts CHANGED
@@ -172,7 +172,7 @@ abstract class Core {
172
172
  if (this.status) {
173
173
  this._send(message);
174
174
  }else{
175
- if (!this.ws?.CONNECTING) this.connect();
175
+ if (this.ws?.readyState !== this.ws?.CONNECTING) this.connect();
176
176
  const event = this.events.addListener('open',() => {
177
177
  this._send(message);
178
178
  event.remove();