stream-chat 6.5.0 → 6.5.1

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/dist/browser.js CHANGED
@@ -5982,7 +5982,7 @@ var StreamChat = /*#__PURE__*/function () {
5982
5982
  }());
5983
5983
 
5984
5984
  _defineProperty__default['default'](this, "openConnection", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
5985
- var _this$wsConnection3, _this$wsFallback3;
5985
+ var _this$wsConnection3, _this$wsConnection4, _this$wsFallback3;
5986
5986
 
5987
5987
  return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
5988
5988
  while (1) {
@@ -5996,18 +5996,30 @@ var StreamChat = /*#__PURE__*/function () {
5996
5996
  throw Error('User is not set on client, use client.connectUser or client.connectAnonymousUser instead');
5997
5997
 
5998
5998
  case 2:
5999
- if (!(((_this$wsConnection3 = _this.wsConnection) !== null && _this$wsConnection3 !== void 0 && _this$wsConnection3.isHealthy || (_this$wsFallback3 = _this.wsFallback) !== null && _this$wsFallback3 !== void 0 && _this$wsFallback3.isHealthy()) && _this._hasConnectionID())) {
5999
+ if (!((_this$wsConnection3 = _this.wsConnection) !== null && _this$wsConnection3 !== void 0 && _this$wsConnection3.isConnecting)) {
6000
6000
  _context3.next = 5;
6001
6001
  break;
6002
6002
  }
6003
6003
 
6004
- _this.logger('info', 'client:openConnection() - openConnection called twice, healthy connection already exists', {
6004
+ _this.logger('info', 'client:openConnection() - connection already in progress', {
6005
6005
  tags: ['connection', 'client']
6006
6006
  });
6007
6007
 
6008
6008
  return _context3.abrupt("return", Promise.resolve());
6009
6009
 
6010
6010
  case 5:
6011
+ if (!(((_this$wsConnection4 = _this.wsConnection) !== null && _this$wsConnection4 !== void 0 && _this$wsConnection4.isHealthy || (_this$wsFallback3 = _this.wsFallback) !== null && _this$wsFallback3 !== void 0 && _this$wsFallback3.isHealthy()) && _this._hasConnectionID())) {
6012
+ _context3.next = 8;
6013
+ break;
6014
+ }
6015
+
6016
+ _this.logger('info', 'client:openConnection() - openConnection called twice, healthy connection already exists', {
6017
+ tags: ['connection', 'client']
6018
+ });
6019
+
6020
+ return _context3.abrupt("return", Promise.resolve());
6021
+
6022
+ case 8:
6011
6023
  _this.clientID = "".concat(_this.userID, "--").concat(randomId());
6012
6024
  _this.wsPromise = _this.connect();
6013
6025
 
@@ -6015,7 +6027,7 @@ var StreamChat = /*#__PURE__*/function () {
6015
6027
 
6016
6028
  return _context3.abrupt("return", _this.wsPromise);
6017
6029
 
6018
- case 9:
6030
+ case 12:
6019
6031
  case "end":
6020
6032
  return _context3.stop();
6021
6033
  }
@@ -7110,7 +7122,7 @@ var StreamChat = /*#__PURE__*/function () {
7110
7122
  }()
7111
7123
  /**
7112
7124
  * createToken - Creates a token to authenticate this user. This function is used server side.
7113
- * The resulting token should be passed to the client side when the users registers or logs in
7125
+ * The resulting token should be passed to the client side when the users registers or logs in.
7114
7126
  *
7115
7127
  * @param {string} userID The User ID
7116
7128
  * @param {number} [exp] The expiration time for the token expressed in the number of seconds since the epoch
@@ -9546,7 +9558,7 @@ var StreamChat = /*#__PURE__*/function () {
9546
9558
  }, {
9547
9559
  key: "getUserAgent",
9548
9560
  value: function getUserAgent() {
9549
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.5.0");
9561
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.5.1");
9550
9562
  }
9551
9563
  }, {
9552
9564
  key: "setUserAgent",