@@ -8,11 +8,7 @@ import {
8
8
import type { DraftResponse } from 'stream-chat' ;
9
9
import { useThreadContext } from '../../../Threads' ;
10
10
import type { StreamMessage } from '../../../../context' ;
11
- import {
12
- useChannelStateContext ,
13
- useChatContext ,
14
- useMessageInputContext ,
15
- } from '../../../../context' ;
11
+ import { useChannelStateContext , useMessageInputContext } from '../../../../context' ;
16
12
17
13
export type UseMessageComposerParams = {
18
14
message ?: DraftResponse | StreamMessage ;
@@ -22,7 +18,6 @@ export type UseMessageComposerParams = {
22
18
export const useMessageComposer = ( {
23
19
textComposerMiddleware,
24
20
} : UseMessageComposerParams = { } ) => {
25
- const { client } = useChatContext ( ) ;
26
21
const { channel } = useChannelStateContext ( ) ;
27
22
const { message : editedMessage } = useMessageInputContext ( ) ;
28
23
// legacy thread will receive new composer
@@ -58,7 +53,7 @@ export const useMessageComposer = ({
58
53
textComposerMiddleware ??
59
54
( [
60
55
createCommandsMiddleware ( channel ) ,
61
- createMentionsMiddleware ( client ) ,
56
+ createMentionsMiddleware ( channel ) ,
62
57
] as TextComposerMiddleware [ ] ) ,
63
58
) ;
64
59
return composer ;
@@ -70,7 +65,7 @@ export const useMessageComposer = ({
70
65
textComposerMiddleware ??
71
66
( [
72
67
createCommandsMiddleware ( channel ) ,
73
- createMentionsMiddleware ( client ) ,
68
+ createMentionsMiddleware ( channel ) ,
74
69
] as TextComposerMiddleware [ ] ) ,
75
70
) ;
76
71
return composer ;
@@ -80,14 +75,7 @@ export const useMessageComposer = ({
80
75
// should never reach this point
81
76
return detachedMesssageComposerRef . current ;
82
77
}
83
- } , [
84
- cachedEditedMessage ,
85
- cachedParentMessage ,
86
- channel ,
87
- client ,
88
- textComposerMiddleware ,
89
- thread ,
90
- ] ) ;
78
+ } , [ cachedEditedMessage , cachedParentMessage , channel , textComposerMiddleware , thread ] ) ;
91
79
92
80
useEffect ( ( ) => {
93
81
messageComposer . registerSubscriptions ( ) ;
0 commit comments