File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/experimental/MessageActions/hooks Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11import { useMemo } from 'react' ;
22
33import { ACTIONS_NOT_WORKING_IN_THREAD , useUserRole } from '../../../components' ;
4- import { useMessageContext } from '../../../context' ;
4+ import { useChannelStateContext , useMessageContext } from '../../../context' ;
55
66import type { MessageActionSetItem } from '../MessageActions' ;
77
@@ -16,6 +16,7 @@ export const useBaseMessageActionSetFilter = (
1616 disable = false ,
1717) => {
1818 const { initialMessage : isInitialMessage , message } = useMessageContext ( ) ;
19+ const { channelConfig } = useChannelStateContext ( ) ;
1920 const {
2021 canDelete,
2122 canEdit,
@@ -56,7 +57,9 @@ export const useBaseMessageActionSetFilter = (
5657 ( type === 'mute' && ! canMute ) ||
5758 ( type === 'quote' && ! canQuote ) ||
5859 ( type === 'react' && ! canReact ) ||
59- ( type === 'reply' && ! canReply )
60+ ( type === 'reply' && ! canReply ) ||
61+ ( type === 'remindMe' && ! channelConfig ?. [ 'user_message_reminders' ] ) ||
62+ ( type === 'saveForLater' && ! channelConfig ?. [ 'user_message_reminders' ] )
6063 )
6164 return false ;
6265
@@ -71,6 +74,7 @@ export const useBaseMessageActionSetFilter = (
7174 canQuote ,
7275 canReact ,
7376 canReply ,
77+ channelConfig ,
7478 isInitialMessage ,
7579 isMessageThreadReply ,
7680 message . status ,
You can’t perform that action at this time.
0 commit comments