larasopp 1.1.1 → 1.1.3

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
@@ -61,7 +61,7 @@ class Core {
61
61
  return this;
62
62
  }
63
63
  try {
64
- this.ws = new WebSocket(this.config.tls ? 'wss' : 'ws' + '://' + this.config.host + '/token=' + this.config.token);
64
+ this.ws = new WebSocket((this.config.tls ? 'wss' : 'ws') + '://' + this.config.host + '/token=' + this.config.token);
65
65
  }
66
66
  catch (e) {
67
67
  console.warn(e);
@@ -82,6 +82,7 @@ class Core {
82
82
  var _a;
83
83
  if (this.status) {
84
84
  (_a = this.ws) === null || _a === void 0 ? void 0 : _a.close();
85
+ this._status = false;
85
86
  }
86
87
  }
87
88
  isJsonString(str) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larasopp",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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
@@ -82,7 +82,7 @@ abstract class Core {
82
82
  }
83
83
 
84
84
  try {
85
- this.ws = new WebSocket(this.config.tls ? 'wss' : 'ws' + '://' + this.config.host + '/token=' + this.config.token);
85
+ this.ws = new WebSocket((this.config.tls ? 'wss' : 'ws') + '://' + this.config.host + '/token=' + this.config.token);
86
86
  }catch(e) {
87
87
  console.warn(e);
88
88
  this.onError('Socket exception');
@@ -104,6 +104,7 @@ abstract class Core {
104
104
  public disconnect(): void {
105
105
  if (this.status) {
106
106
  this.ws?.close();
107
+ this._status = false;
107
108
  }
108
109
  }
109
110