From 566ac6dfa6e73140a31db173062d5a406af78455 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Tue, 1 Sep 2026 15:19:52 +0530 Subject: [PATCH] fix reaction local echo redaction --- src/app/features/room/hooks/useSendReaction.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/features/room/hooks/useSendReaction.ts b/src/app/features/room/hooks/useSendReaction.ts index 1037d10c..86d00931 100644 --- a/src/app/features/room/hooks/useSendReaction.ts +++ b/src/app/features/room/hooks/useSendReaction.ts @@ -6,6 +6,7 @@ import { useClient } from '../../../hooks/useClient'; import { EventSenderError, EventSenderIdle, + EventSenderSuccess, LocalEvent, LocalEventSender, LocalMessage, @@ -61,7 +62,7 @@ export const useSendReaction = ( useEffect(() => { const unsub = reactionSender?.state.subscribe((state) => { - if (state instanceof EventSenderError) { + if (state instanceof EventSenderError || state instanceof EventSenderIdle) { setReactionSender(undefined); } }); @@ -71,10 +72,13 @@ export const useSendReaction = ( }, [reactionSender]); const sendingRel = reactionSender?.localEvent.original.content['m.relates_to']; + const senderRedacted = + reactionSender?.state.read instanceof EventSenderSuccess && + redacted.has(reactionSender.state.read.eventId); return { reactionSender: - sendingRel && hasExistingReaction(sendingRel.event_id, sendingRel.key) + (sendingRel && hasExistingReaction(sendingRel.event_id, sendingRel.key)) || senderRedacted ? undefined : reactionSender, handleAddReaction,