stream-chat-react 13.13.4 → 13.13.5

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.
@@ -24,7 +24,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
24
24
  useEffect(() => {
25
25
  if (!client)
26
26
  return;
27
- const version = "13.13.4";
27
+ const version = "13.13.5";
28
28
  const userAgent = client.getUserAgent();
29
29
  if (!userAgent.includes('stream-chat-react')) {
30
30
  // result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
@@ -19,6 +19,8 @@ export const useMarkRead = ({ isMessageListScrolledToBottom, messageListIsThread
19
19
  const { markRead, setChannelUnreadUiState } = useChannelActionContext('useMarkRead');
20
20
  const { channel } = useChannelStateContext('useMarkRead');
21
21
  useEffect(() => {
22
+ if (!channel.getConfig()?.read_events)
23
+ return;
22
24
  const shouldMarkRead = () => !document.hidden &&
23
25
  !wasMarkedUnread &&
24
26
  !messageListIsThread &&
@@ -28641,6 +28641,7 @@ var useMarkRead = ({
28641
28641
  const { markRead, setChannelUnreadUiState } = useChannelActionContext("useMarkRead");
28642
28642
  const { channel } = useChannelStateContext("useMarkRead");
28643
28643
  (0, import_react173.useEffect)(() => {
28644
+ if (!channel.getConfig()?.read_events) return;
28644
28645
  const shouldMarkRead = () => !document.hidden && !wasMarkedUnread && !messageListIsThread && isMessageListScrolledToBottom && client.user?.id && !hasReadLastMessage(channel, client.user.id);
28645
28646
  const onVisibilityChange = () => {
28646
28647
  if (shouldMarkRead()) markRead();
@@ -37418,7 +37419,7 @@ var useChat = ({
37418
37419
  };
37419
37420
  (0, import_react289.useEffect)(() => {
37420
37421
  if (!client) return;
37421
- const version = "13.13.4";
37422
+ const version = "13.13.5";
37422
37423
  const userAgent = client.getUserAgent();
37423
37424
  if (!userAgent.includes("stream-chat-react")) {
37424
37425
  client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);