stream-chat 4.5.0-beta.0 → 5.0.0

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
@@ -967,13 +967,23 @@ function convertErrorToJson(err) {
967
967
  return jsonObj;
968
968
  }
969
969
  /**
970
- * isOnline safely return the navigator.online value
970
+ * isOnline safely return the navigator.online value for browser env
971
971
  * if navigator is not in global object, it always return true
972
972
  */
973
973
 
974
974
  function isOnline() {
975
975
  var nav = typeof navigator !== 'undefined' ? navigator : typeof window !== 'undefined' && window.navigator ? window.navigator : undefined;
976
- if (!nav) return true;
976
+
977
+ if (!nav) {
978
+ console.warn('isOnline failed to access window.navigator and assume browser is online');
979
+ return true;
980
+ } // RN navigator has undefined for onLine
981
+
982
+
983
+ if (typeof nav.onLine !== 'boolean') {
984
+ return true;
985
+ }
986
+
977
987
  return nav.onLine;
978
988
  }
979
989
  /**
@@ -5266,7 +5276,7 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5266
5276
 
5267
5277
  _this._log("disconnect() - Failed", {
5268
5278
  err: _context4.t0
5269
- });
5279
+ }, 'error');
5270
5280
 
5271
5281
  case 15:
5272
5282
  case "end":
@@ -6086,8 +6096,6 @@ var StreamChat = /*#__PURE__*/function () {
6086
6096
  return JSON.stringify({
6087
6097
  user_id: _this.userID,
6088
6098
  user_details: _this._user,
6089
- user_token: _this.tokenManager.getToken(),
6090
- server_determines_connection_id: true,
6091
6099
  device: _this.options.device,
6092
6100
  client_request_id: client_request_id
6093
6101
  });
@@ -8051,27 +8059,15 @@ var StreamChat = /*#__PURE__*/function () {
8051
8059
  while (1) {
8052
8060
  switch (_context32.prev = _context32.next) {
8053
8061
  case 0:
8054
- if ((options === null || options === void 0 ? void 0 : options.user_id) !== undefined) {
8055
- options.banned_by_id = options.user_id;
8056
- delete options.user_id;
8057
- console.warn("banUser: 'user_id' is deprecated, please consider switching to 'banned_by_id'");
8058
- }
8059
-
8060
- if ((options === null || options === void 0 ? void 0 : options.user) !== undefined) {
8061
- options.banned_by = options.user;
8062
- delete options.user;
8063
- console.warn("banUser: 'user' is deprecated, please consider switching to 'banned_by'");
8064
- }
8065
-
8066
- _context32.next = 4;
8062
+ _context32.next = 2;
8067
8063
  return this.post(this.baseURL + '/moderation/ban', _objectSpread({
8068
8064
  target_user_id: targetUserID
8069
8065
  }, options));
8070
8066
 
8071
- case 4:
8067
+ case 2:
8072
8068
  return _context32.abrupt("return", _context32.sent);
8073
8069
 
8074
- case 5:
8070
+ case 3:
8075
8071
  case "end":
8076
8072
  return _context32.stop();
8077
8073
  }
@@ -8885,7 +8881,7 @@ var StreamChat = /*#__PURE__*/function () {
8885
8881
  }, {
8886
8882
  key: "getUserAgent",
8887
8883
  value: function getUserAgent() {
8888
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.5.0-beta.0");
8884
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.0.0");
8889
8885
  }
8890
8886
  }, {
8891
8887
  key: "setUserAgent",