feat(reactions): dont double send reaction

This commit is contained in:
wcjord 2025-06-09 16:37:34 -04:00
parent 0a5f77e413
commit 1f001eb144

View file

@ -1541,9 +1541,11 @@ class ChatController extends State<ChatPageWithRoom>
// 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,
)) {
if (timeline == null ||
events.any(
(e) => e.aggregatedEvents(timeline!, RelationshipTypes.reaction).any(
(re) => re.content.tryGetMap('m.relates_to')?['key'] == emoji),
)) {
return;
}