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