UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

13 lines (12 loc) 546 B
import { useChannelActionContext } from '../../../context/ChannelActionContext'; export const useOpenThreadHandler = (message, customOpenThread) => { const { openThread: channelOpenThread } = useChannelActionContext('useOpenThreadHandler'); const openThread = customOpenThread || channelOpenThread; return (event) => { if (!openThread || !message) { console.warn('Open thread handler was called but it is missing one of its parameters'); return; } openThread(message, event); }; };