Reactions: Fix repeated effect playback if paused before ending (#2657)

This commit is contained in:
Alexander Zinchuk 2023-02-25 18:50:21 +01:00
parent 4c350d53b4
commit 401895c932
2 changed files with 9 additions and 18 deletions

View File

@ -8,7 +8,6 @@ import {
selectDefaultReaction,
selectMaxUserReactions,
selectMessageIdsByGroupId,
selectCurrentMessageList,
} from '../../selectors';
import { addMessageReaction, subtractXForEmojiInteraction, updateUnreadReactions } from '../../reducers/reactions';
import {
@ -159,17 +158,6 @@ addActionHandler('toggleReaction', (global, actions, payload): ActionReturnType
return addMessageReaction(global, message, reactions);
});
addActionHandler('openChat', (global, actions, payload): ActionReturnType => {
const { id, tabId = getCurrentTabId() } = payload;
const currentChatId = selectCurrentMessageList(global, tabId)?.chatId;
if (currentChatId === id) return global;
return updateTabState(global, {
activeReactions: {},
}, tabId);
});
addActionHandler('stopActiveReaction', (global, actions, payload): ActionReturnType => {
const { messageId, reaction, tabId = getCurrentTabId() } = payload;

View File

@ -34,14 +34,17 @@ addActionHandler('openChat', (global, actions, payload): ActionReturnType => {
}, tabId);
}
if (!currentMessageList
|| (
currentMessageList.chatId !== id
|| currentMessageList.threadId !== threadId
|| currentMessageList.type !== type
)) {
if (!currentMessageList || (
currentMessageList.chatId !== id
|| currentMessageList.threadId !== threadId
|| currentMessageList.type !== type
)) {
if (id) {
global = replaceTabThreadParam(global, id, threadId, 'replyStack', [], tabId);
global = updateTabState(global, {
activeReactions: {},
}, tabId);
}
global = exitMessageSelectMode(global, tabId);