File tree Expand file tree Collapse file tree 2 files changed +7
-21
lines changed
Expand file tree Collapse file tree 2 files changed +7
-21
lines changed Original file line number Diff line number Diff line change @@ -77,27 +77,7 @@ export const handleEventToSyncDB = async <
7777 return createQueries ( flush ) ;
7878 } ;
7979
80- if ( type === 'message.read' ) {
81- const cid = event . cid ;
82- const user = event . user ;
83- if ( user ?. id && cid ) {
84- return await queriesWithChannelGuard ( ( flushOverride ) =>
85- upsertReads ( {
86- cid,
87- flush : flushOverride ,
88- reads : [
89- {
90- last_read : event . received_at as string ,
91- unread_messages : 0 ,
92- user,
93- } ,
94- ] ,
95- } ) ,
96- ) ;
97- }
98- }
99-
100- if ( type === 'notification.mark_read' ) {
80+ if ( type === 'message.read' || type === 'notification.mark_read' ) {
10181 const cid = event . cid ;
10282 const user = event . user ;
10383 if ( user ?. id && cid ) {
Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ export type ChannelContextValue<
6262 hideStickyDateHeader : boolean ;
6363 /**
6464 * Loads channel around a specific message
65+ * @param limit - The number of messages to load around the message
66+ * @param messageId - The message around which to load messages
67+ * @param setTargetedMessage - Callback to set the targeted message
6568 */
6669 loadChannelAroundMessage : ( {
6770 limit,
@@ -75,6 +78,9 @@ export type ChannelContextValue<
7578
7679 /**
7780 * Loads channel at first unread message.
81+ * @param channelUnreadState - The unread state of the channel
82+ * @param limit - The number of messages to load around the first unread message
83+ * @param setChannelUnreadState - Callback to set the channel unread state
7884 */
7985 loadChannelAtFirstUnreadMessage : ( {
8086 channelUnreadState,
You can’t perform that action at this time.
0 commit comments