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/index.js CHANGED
@@ -971,13 +971,23 @@ function convertErrorToJson(err) {
971
971
  return jsonObj;
972
972
  }
973
973
  /**
974
- * isOnline safely return the navigator.online value
974
+ * isOnline safely return the navigator.online value for browser env
975
975
  * if navigator is not in global object, it always return true
976
976
  */
977
977
 
978
978
  function isOnline() {
979
979
  var nav = typeof navigator !== 'undefined' ? navigator : typeof window !== 'undefined' && window.navigator ? window.navigator : undefined;
980
- if (!nav) return true;
980
+
981
+ if (!nav) {
982
+ console.warn('isOnline failed to access window.navigator and assume browser is online');
983
+ return true;
984
+ } // RN navigator has undefined for onLine
985
+
986
+
987
+ if (typeof nav.onLine !== 'boolean') {
988
+ return true;
989
+ }
990
+
981
991
  return nav.onLine;
982
992
  }
983
993
  /**
@@ -5272,7 +5282,7 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5272
5282
 
5273
5283
  _this._log("disconnect() - Failed", {
5274
5284
  err: _context4.t0
5275
- });
5285
+ }, 'error');
5276
5286
 
5277
5287
  case 15:
5278
5288
  case "end":
@@ -6092,8 +6102,6 @@ var StreamChat = /*#__PURE__*/function () {
6092
6102
  return JSON.stringify({
6093
6103
  user_id: _this.userID,
6094
6104
  user_details: _this._user,
6095
- user_token: _this.tokenManager.getToken(),
6096
- server_determines_connection_id: true,
6097
6105
  device: _this.options.device,
6098
6106
  client_request_id: client_request_id
6099
6107
  });
@@ -8057,27 +8065,15 @@ var StreamChat = /*#__PURE__*/function () {
8057
8065
  while (1) {
8058
8066
  switch (_context32.prev = _context32.next) {
8059
8067
  case 0:
8060
- if ((options === null || options === void 0 ? void 0 : options.user_id) !== undefined) {
8061
- options.banned_by_id = options.user_id;
8062
- delete options.user_id;
8063
- console.warn("banUser: 'user_id' is deprecated, please consider switching to 'banned_by_id'");
8064
- }
8065
-
8066
- if ((options === null || options === void 0 ? void 0 : options.user) !== undefined) {
8067
- options.banned_by = options.user;
8068
- delete options.user;
8069
- console.warn("banUser: 'user' is deprecated, please consider switching to 'banned_by'");
8070
- }
8071
-
8072
- _context32.next = 4;
8068
+ _context32.next = 2;
8073
8069
  return this.post(this.baseURL + '/moderation/ban', _objectSpread({
8074
8070
  target_user_id: targetUserID
8075
8071
  }, options));
8076
8072
 
8077
- case 4:
8073
+ case 2:
8078
8074
  return _context32.abrupt("return", _context32.sent);
8079
8075
 
8080
- case 5:
8076
+ case 3:
8081
8077
  case "end":
8082
8078
  return _context32.stop();
8083
8079
  }
@@ -8891,7 +8887,7 @@ var StreamChat = /*#__PURE__*/function () {
8891
8887
  }, {
8892
8888
  key: "getUserAgent",
8893
8889
  value: function getUserAgent() {
8894
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.5.0-beta.0");
8890
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.0.0");
8895
8891
  }
8896
8892
  }, {
8897
8893
  key: "setUserAgent",