larasopp 1.2.3 → 1.2.4

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
@@ -133,8 +133,6 @@ class Core {
133
133
  return this._socketId;
134
134
  }
135
135
  get status() {
136
- if (!this._status)
137
- this.connect();
138
136
  return this._status;
139
137
  }
140
138
  _send(message) {
@@ -143,10 +141,13 @@ class Core {
143
141
  this.ws.send(JSON.stringify(message));
144
142
  }
145
143
  send(message) {
144
+ var _a;
146
145
  if (this.status) {
147
146
  this._send(message);
148
147
  }
149
148
  else {
149
+ if (!((_a = this.ws) === null || _a === void 0 ? void 0 : _a.CONNECTING))
150
+ this.connect();
150
151
  const event = this.events.addListener('open', () => {
151
152
  this._send(message);
152
153
  event.remove();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larasopp",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
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
@@ -160,7 +160,6 @@ abstract class Core {
160
160
  }
161
161
 
162
162
  public get status(): boolean {
163
- if (!this._status) this.connect();
164
163
  return this._status;
165
164
  }
166
165
 
@@ -173,6 +172,7 @@ abstract class Core {
173
172
  if (this.status) {
174
173
  this._send(message);
175
174
  }else{
175
+ if (!this.ws?.CONNECTING) this.connect();
176
176
  const event = this.events.addListener('open',() => {
177
177
  this._send(message);
178
178
  event.remove();