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.es.js CHANGED
@@ -948,13 +948,23 @@ function convertErrorToJson(err) {
948
948
  return jsonObj;
949
949
  }
950
950
  /**
951
- * isOnline safely return the navigator.online value
951
+ * isOnline safely return the navigator.online value for browser env
952
952
  * if navigator is not in global object, it always return true
953
953
  */
954
954
 
955
955
  function isOnline() {
956
956
  var nav = typeof navigator !== 'undefined' ? navigator : typeof window !== 'undefined' && window.navigator ? window.navigator : undefined;
957
- if (!nav) return true;
957
+
958
+ if (!nav) {
959
+ console.warn('isOnline failed to access window.navigator and assume browser is online');
960
+ return true;
961
+ } // RN navigator has undefined for onLine
962
+
963
+
964
+ if (typeof nav.onLine !== 'boolean') {
965
+ return true;
966
+ }
967
+
958
968
  return nav.onLine;
959
969
  }
960
970
  /**
@@ -5249,7 +5259,7 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5249
5259
 
5250
5260
  _this._log("disconnect() - Failed", {
5251
5261
  err: _context4.t0
5252
- });
5262
+ }, 'error');
5253
5263
 
5254
5264
  case 15:
5255
5265
  case "end":
@@ -6069,8 +6079,6 @@ var StreamChat = /*#__PURE__*/function () {
6069
6079
  return JSON.stringify({
6070
6080
  user_id: _this.userID,
6071
6081
  user_details: _this._user,
6072
- user_token: _this.tokenManager.getToken(),
6073
- server_determines_connection_id: true,
6074
6082
  device: _this.options.device,
6075
6083
  client_request_id: client_request_id
6076
6084
  });
@@ -8034,27 +8042,15 @@ var StreamChat = /*#__PURE__*/function () {
8034
8042
  while (1) {
8035
8043
  switch (_context32.prev = _context32.next) {
8036
8044
  case 0:
8037
- if ((options === null || options === void 0 ? void 0 : options.user_id) !== undefined) {
8038
- options.banned_by_id = options.user_id;
8039
- delete options.user_id;
8040
- console.warn("banUser: 'user_id' is deprecated, please consider switching to 'banned_by_id'");
8041
- }
8042
-
8043
- if ((options === null || options === void 0 ? void 0 : options.user) !== undefined) {
8044
- options.banned_by = options.user;
8045
- delete options.user;
8046
- console.warn("banUser: 'user' is deprecated, please consider switching to 'banned_by'");
8047
- }
8048
-
8049
- _context32.next = 4;
8045
+ _context32.next = 2;
8050
8046
  return this.post(this.baseURL + '/moderation/ban', _objectSpread({
8051
8047
  target_user_id: targetUserID
8052
8048
  }, options));
8053
8049
 
8054
- case 4:
8050
+ case 2:
8055
8051
  return _context32.abrupt("return", _context32.sent);
8056
8052
 
8057
- case 5:
8053
+ case 3:
8058
8054
  case "end":
8059
8055
  return _context32.stop();
8060
8056
  }
@@ -8868,7 +8864,7 @@ var StreamChat = /*#__PURE__*/function () {
8868
8864
  }, {
8869
8865
  key: "getUserAgent",
8870
8866
  value: function getUserAgent() {
8871
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.5.0-beta.0");
8867
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.0.0");
8872
8868
  }
8873
8869
  }, {
8874
8870
  key: "setUserAgent",