File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
package/src/components/Message/hooks Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,15 @@ const isOwnReaction = <
5454> (
5555 reactionType : string ,
5656 ownReactions ?: MessageReactionsData < StreamChatGenerics > [ 'own_reactions' ] ,
57- ) => ( ownReactions ? ownReactions . some ( ( reaction ) => reaction . type === reactionType ) : false ) ;
57+ latestReactions ?: ReactionResponse < StreamChatGenerics > [ ] | null ,
58+ userID ?: string ,
59+ ) =>
60+ ( ownReactions ? ownReactions . some ( ( reaction ) => reaction . type === reactionType ) : false ) ||
61+ ( latestReactions
62+ ? latestReactions . some (
63+ ( reaction ) => reaction ?. user ?. id === userID && reaction . type === reactionType ,
64+ )
65+ : false ) ;
5866
5967const isSupportedReaction = ( reactionType : string , supportedReactions ?: ReactionData [ ] ) =>
6068 supportedReactions
@@ -109,7 +117,12 @@ export const useProcessReactions = <
109117 Icon : getEmojiByReactionType ( reactionType , supportedReactions ) ,
110118 lastReactionAt : last_reaction_at ? new Date ( last_reaction_at ) : null ,
111119 latestReactedUserNames,
112- own : isOwnReaction < StreamChatGenerics > ( reactionType , own_reactions ) ,
120+ own : isOwnReaction < StreamChatGenerics > (
121+ reactionType ,
122+ own_reactions ,
123+ latest_reactions ,
124+ client . userID ,
125+ ) ,
113126 type : reactionType ,
114127 unlistedReactedUserCount : count - latestReactedUserNames . length ,
115128 } ;
You can’t perform that action at this time.
0 commit comments