diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index 422a81875..501e5aabf 100644 --- a/src/components/middle/message/Message.tsx +++ b/src/components/middle/message/Message.tsx @@ -96,11 +96,11 @@ import { getMinMediaWidth, calculateMediaDimensions } from './helpers/mediaDimen import { calculateAlbumLayout } from './helpers/calculateAlbumLayout'; import renderText from '../../common/helpers/renderText'; import calculateAuthorWidth from './helpers/calculateAuthorWidth'; -import { isAnimatingScroll } from '../../../util/fastSmoothScroll'; - import { getServerTime } from '../../../util/serverTime'; import { isElementInViewport } from '../../../util/isElementInViewport'; import { getCustomEmojiSize } from '../composer/helpers/customEmoji'; +import { isAnimatingScroll } from '../../../util/fastSmoothScroll'; + import useEnsureMessage from '../../../hooks/useEnsureMessage'; import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers'; import { useOnIntersect } from '../../../hooks/useIntersectionObserver'; @@ -110,8 +110,8 @@ import useFlag from '../../../hooks/useFlag'; import useFocusMessage from './hooks/useFocusMessage'; import useOuterHandlers from './hooks/useOuterHandlers'; import useInnerHandlers from './hooks/useInnerHandlers'; -import useResizeObserver from '../../../hooks/useResizeObserver'; import useAppLayout from '../../../hooks/useAppLayout'; +import useResizeObserver from '../../../hooks/useResizeObserver'; import Button from '../../ui/Button'; import Avatar from '../../common/Avatar'; diff --git a/src/global/actions/api/reactions.ts b/src/global/actions/api/reactions.ts index 6bc98bb5d..5b99f49bb 100644 --- a/src/global/actions/api/reactions.ts +++ b/src/global/actions/api/reactions.ts @@ -9,6 +9,7 @@ import { selectLocalAnimatedEmojiEffectByName, selectMaxUserReactions, selectMessageIdsByGroupId, + selectCurrentMessageList, } from '../../selectors'; import { addMessageReaction, subtractXForEmojiInteraction, updateUnreadReactions } from '../../reducers/reactions'; import { @@ -160,7 +161,10 @@ addActionHandler('toggleReaction', (global, actions, payload): ActionReturnType }); addActionHandler('openChat', (global, actions, payload): ActionReturnType => { - const { tabId = getCurrentTabId() } = payload; + const { id, tabId = getCurrentTabId() } = payload; + const currentChatId = selectCurrentMessageList(global, tabId)?.chatId; + + if (currentChatId === id) return global; return updateTabState(global, { activeReactions: {},