File tree 1 file changed +3
-1
lines changed
package/src/components/MessageList
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -533,7 +533,6 @@ const MessageListWithContext = <
533
533
const shouldMarkRead = ( ) => {
534
534
return (
535
535
! channelUnreadState ?. first_unread_message_id &&
536
- ! threadList &&
537
536
! scrollToBottomButtonVisible &&
538
537
client . user ?. id &&
539
538
! hasReadLastMessage ( channel , client . user ?. id )
@@ -542,6 +541,7 @@ const MessageListWithContext = <
542
541
543
542
const handleEvent = async ( event : Event < StreamChatGenerics > ) => {
544
543
const mainChannelUpdated = ! event . message ?. parent_id || event . message ?. show_in_channel ;
544
+ console . log ( mainChannelUpdated , shouldMarkRead ( ) ) ;
545
545
// When the scrollToBottomButtonVisible is true, we need to manually update the channelUnreadState.
546
546
if ( scrollToBottomButtonVisible || channelUnreadState ?. first_unread_message_id ) {
547
547
setChannelUnreadState ( ( prev ) => {
@@ -561,6 +561,7 @@ const MessageListWithContext = <
561
561
} ;
562
562
} ) ;
563
563
} else if ( mainChannelUpdated && shouldMarkRead ( ) ) {
564
+ console . log ( 'marking read' ) ;
564
565
await markRead ( ) ;
565
566
}
566
567
} ;
@@ -618,6 +619,7 @@ const MessageListWithContext = <
618
619
setTimeout ( ( ) => {
619
620
channelResyncScrollSet . current = true ;
620
621
if ( channel . countUnread ( ) > 0 ) {
622
+ console . log ( 'marking read' ) ;
621
623
markRead ( ) ;
622
624
}
623
625
} , 500 ) ;
You can’t perform that action at this time.
0 commit comments