From 85a103c5fc8785698a56e6a9b83e5fc4447cea87 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Mon, 18 Jan 2021 15:06:43 +0530 Subject: [PATCH] fix: get reaction by user and reaction type --- lib/src/reaction_picker.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/src/reaction_picker.dart b/lib/src/reaction_picker.dart index bdbcc669..8d1c6d7b 100644 --- a/lib/src/reaction_picker.dart +++ b/lib/src/reaction_picker.dart @@ -31,8 +31,11 @@ class ReactionPicker extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: reactionToEmoji.keys.map((reactionType) { - final ownReactionIndex = message.latestReactions - ?.indexWhere((reaction) => reaction.type == reactionType) ?? + var user = StreamChat.of(context).user; + final ownReactionIndex = message.latestReactions?.indexWhere( + (reaction) => + reaction.type == reactionType && + reaction.userId == user.id) ?? -1; return Column( mainAxisSize: MainAxisSize.min,