diff --git a/web/chat/reaction-message-utils.js b/web/chat/reaction-message-utils.js --- a/web/chat/reaction-message-utils.js +++ b/web/chat/reaction-message-utils.js @@ -16,6 +16,7 @@ function useOnClickReact( messageID: ?string, + localID: string, threadID: string, reaction: string, action: 'add_reaction' | 'remove_reaction', @@ -37,6 +38,7 @@ try { const result = await callSendReactionMessage({ threadID, + localID, targetMessageID: messageID, reaction, action, @@ -70,6 +72,7 @@ pushModal, reaction, threadID, + localID, ], ); } diff --git a/web/utils/tooltip-utils.js b/web/utils/tooltip-utils.js --- a/web/utils/tooltip-utils.js +++ b/web/utils/tooltip-utils.js @@ -5,7 +5,7 @@ import * as React from 'react'; import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors'; -import { createMessageReply } from 'lib/shared/message-utils'; +import { localIDPrefix, createMessageReply } from 'lib/shared/message-utils'; import { useCanCreateReactionFromMessage } from 'lib/shared/reaction-utils'; import { threadHasPermission, @@ -28,6 +28,7 @@ import { useTooltipContext } from '../chat/tooltip-provider'; import CommIcon from '../CommIcon.react'; import { InputStateContext } from '../input/input-state'; +import { useSelector } from '../redux/redux-utils'; import { useOnClickPendingSidebar, useOnClickThread, @@ -458,12 +459,16 @@ ): ?MessageTooltipAction { const { messageInfo, reactions } = item; + const nextLocalID = useSelector(state => state.nextLocalID); + const localID = `${localIDPrefix}${nextLocalID}`; + const reactionInput = '👍'; const viewerReacted = !!reactions.get(reactionInput)?.viewerReacted; const action = viewerReacted ? 'remove_reaction' : 'add_reaction'; const onClickReact = useOnClickReact( messageInfo.id, + localID, threadInfo.id, reactionInput, action,