From a07fdda490e8b57393e54d0e2270a6565974fec9 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 1 Feb 2022 12:16:40 +0100 Subject: [PATCH] fix latest reaction when sending a new reaction --- packages/stream_chat/lib/src/client/channel.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/stream_chat/lib/src/client/channel.dart b/packages/stream_chat/lib/src/client/channel.dart index 5dde59cf..41197572 100644 --- a/packages/stream_chat/lib/src/client/channel.dart +++ b/packages/stream_chat/lib/src/client/channel.dart @@ -833,10 +833,11 @@ class Channel { extraData: extraData, ); - latestReactions = latestReactions - // Inserting at the 0th index as it's the latest reaction - ..insert(0, newReaction) - ..take(10); + latestReactions = (latestReactions + // Inserting at the 0th index as it's the latest reaction + ..insert(0, newReaction)) + .take(10) + .toList(); final ownReactions = enforceUnique ? [newReaction] : [