File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
package/src/contexts/channelsStateContext Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export function useChannelState(
4545 const cid = channel ?. id || 'id' ; // in case channel is not initialized, use generic id string for indexing
4646 const { setState, state } = useChannelsStateContext ( ) ;
4747
48- const [ threadMessages , setThreadMessages ] = useStateManager (
48+ const [ threadMessages , setThreadMessagesInternal ] = useStateManager (
4949 {
5050 cid,
5151 key : 'threadMessages' ,
@@ -54,6 +54,10 @@ export function useChannelState(
5454 } ,
5555 ( threadId && channel ?. state ?. threads ?. [ threadId ] ) || [ ] ,
5656 ) ;
57+ const setThreadMessages = useCallback (
58+ ( value : ChannelState [ 'threadMessages' ] ) => setThreadMessagesInternal ( [ ...value ] ) ,
59+ [ setThreadMessagesInternal ] ,
60+ ) ;
5761
5862 return {
5963 setThreadMessages,
You can’t perform that action at this time.
0 commit comments