From 098df491e00f2721b9b401ab99c2e30bd3fb8188 Mon Sep 17 00:00:00 2001 From: Khushal Agarwal Date: Tue, 17 Dec 2024 13:51:27 +0530 Subject: [PATCH] fix: create new channel bug --- .../NewDirectMessagingSendButton.tsx | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/examples/SampleApp/src/components/NewDirectMessagingSendButton.tsx b/examples/SampleApp/src/components/NewDirectMessagingSendButton.tsx index 557820c63..0d1037e5e 100644 --- a/examples/SampleApp/src/components/NewDirectMessagingSendButton.tsx +++ b/examples/SampleApp/src/components/NewDirectMessagingSendButton.tsx @@ -17,6 +17,8 @@ import { import { NewDirectMessagingScreenNavigationProp } from '../screens/NewDirectMessagingScreen'; import { StreamChatGenerics as LocalStreamChatGenerics } from '../types'; +import { useUserSearchContext } from '../context/UserSearchContext'; +import { useAppContext } from '../context/AppContext'; type NewDirectMessagingSendButtonPropsWithContext< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, @@ -97,8 +99,10 @@ export type SendButtonProps< * UI Component for send button in MessageInput component. */ export const NewDirectMessagingSendButton = (props: SendButtonProps) => { + const { chatClient } = useAppContext(); const navigation = useNavigation(); const { channel } = useChannelContext(); + const { selectedUserIds, reset } = useUserSearchContext(); const { giphyActive, text } = useMessageInputContext(); @@ -106,15 +110,25 @@ export const NewDirectMessagingSendButton = (props: SendButtonProps