File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
package/src/components/ChannelPreview/hooks Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ export const useChannelPreviewData = <
3030 const channelLastMessage = channel . lastMessage ( ) ;
3131 const channelLastMessageString = `${ channelLastMessage ?. id } ${ channelLastMessage ?. updated_at } ` ;
3232
33+ useEffect ( ( ) => {
34+ const { unsubscribe } = client . on ( 'notification.mark_read' , ( ) => {
35+ setUnread ( channel . countUnread ( ) ) ;
36+ } ) ;
37+ return unsubscribe ;
38+ } , [ channel , client ] ) ;
39+
3340 useEffect ( ( ) => {
3441 if (
3542 channelLastMessage &&
@@ -56,7 +63,7 @@ export const useChannelPreviewData = <
5663 setForceUpdate ( ( prev ) => prev + 1 ) ;
5764 }
5865 } ;
59- const { unsubscribe } = client . on ( 'notification.mark_read ' , handleReadEvent ) ;
66+ const { unsubscribe } = client . on ( 'message.read ' , handleReadEvent ) ;
6067 return unsubscribe ;
6168 } , [ client , channel ] ) ;
6269
You can’t perform that action at this time.
0 commit comments