stream-chat-react 13.10.1 → 13.10.2

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.10.1";
27
+ const version = "13.10.2";
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'
@@ -1,6 +1,6 @@
1
1
  import { useMemo } from 'react';
2
2
  import { ACTIONS_NOT_WORKING_IN_THREAD, useUserRole } from '../../../components';
3
- import { useMessageContext } from '../../../context';
3
+ import { useChannelStateContext, useMessageContext } from '../../../context';
4
4
  /**
5
5
  * Base filter hook which covers actions of type `delete`, `edit`,
6
6
  * `flag`, `markUnread`, `mute`, `quote`, `react` and `reply`, whether
@@ -9,6 +9,7 @@ import { useMessageContext } from '../../../context';
9
9
  */
10
10
  export const useBaseMessageActionSetFilter = (messageActionSet, disable = false) => {
11
11
  const { initialMessage: isInitialMessage, message } = useMessageContext();
12
+ const { channelConfig } = useChannelStateContext();
12
13
  const { canDelete, canEdit, canFlag, canMarkUnread, canMute, canQuote, canReact, canReply, } = useUserRole(message);
13
14
  const isMessageThreadReply = typeof message.parent_id === 'string';
14
15
  return useMemo(() => {
@@ -34,7 +35,9 @@ export const useBaseMessageActionSetFilter = (messageActionSet, disable = false)
34
35
  (type === 'mute' && !canMute) ||
35
36
  (type === 'quote' && !canQuote) ||
36
37
  (type === 'react' && !canReact) ||
37
- (type === 'reply' && !canReply))
38
+ (type === 'reply' && !canReply) ||
39
+ (type === 'remindMe' && !channelConfig?.['user_message_reminders']) ||
40
+ (type === 'saveForLater' && !channelConfig?.['user_message_reminders']))
38
41
  return false;
39
42
  return true;
40
43
  });
@@ -47,6 +50,7 @@ export const useBaseMessageActionSetFilter = (messageActionSet, disable = false)
47
50
  canQuote,
48
51
  canReact,
49
52
  canReply,
53
+ channelConfig,
50
54
  isInitialMessage,
51
55
  isMessageThreadReply,
52
56
  message.status,
@@ -14944,6 +14944,7 @@ var useSearchQueriesInProgress = (searchController) => {
14944
14944
  var import_react40 = require("react");
14945
14945
  var useBaseMessageActionSetFilter = (messageActionSet, disable2 = false) => {
14946
14946
  const { initialMessage: isInitialMessage, message } = useMessageContext();
14947
+ const { channelConfig } = useChannelStateContext();
14947
14948
  const {
14948
14949
  canDelete,
14949
14950
  canEdit,
@@ -14963,7 +14964,7 @@ var useBaseMessageActionSetFilter = (messageActionSet, disable2 = false) => {
14963
14964
  return messageActionSet.filter(({ type }) => {
14964
14965
  if (ACTIONS_NOT_WORKING_IN_THREAD.includes(type) && isMessageThreadReply)
14965
14966
  return false;
14966
- if (type === "delete" && !canDelete || type === "edit" && !canEdit || type === "flag" && !canFlag || type === "markUnread" && !canMarkUnread || type === "mute" && !canMute || type === "quote" && !canQuote || type === "react" && !canReact || type === "reply" && !canReply)
14967
+ if (type === "delete" && !canDelete || type === "edit" && !canEdit || type === "flag" && !canFlag || type === "markUnread" && !canMarkUnread || type === "mute" && !canMute || type === "quote" && !canQuote || type === "react" && !canReact || type === "reply" && !canReply || type === "remindMe" && !channelConfig?.["user_message_reminders"] || type === "saveForLater" && !channelConfig?.["user_message_reminders"])
14967
14968
  return false;
14968
14969
  return true;
14969
14970
  });
@@ -14976,6 +14977,7 @@ var useBaseMessageActionSetFilter = (messageActionSet, disable2 = false) => {
14976
14977
  canQuote,
14977
14978
  canReact,
14978
14979
  canReply,
14980
+ channelConfig,
14979
14981
  isInitialMessage,
14980
14982
  isMessageThreadReply,
14981
14983
  message.status,