From 0a5f77e4131deec0cf47b904bdb433b054548ff6 Mon Sep 17 00:00:00 2001 From: wcjord <32568597+wcjord@users.noreply.github.com> Date: Mon, 9 Jun 2025 13:48:14 -0400 Subject: [PATCH] don't send the same reaction twice --- lib/pages/chat/chat.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index ec5e8da48..60a6ec49d 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1540,8 +1540,14 @@ class ChatController extends State // keep this event selected in case the user wants to send another emoji // setState(() => selectedEvents.clear()); // Pangea# + // if reaction already exists, don't send it again + if (_allReactionEvents.any( + (e) => e.content.tryGetMap('m.relates_to')?['key'] == emoji, + )) { + return; + } + for (final event in events) { - // if reaction already exists, don't send it again await room.sendReaction( event.eventId, emoji!,