Reactions: Fix repeated effect playback if paused before ending (#2657)
This commit is contained in:
parent
4c350d53b4
commit
401895c932
@ -8,7 +8,6 @@ import {
|
|||||||
selectDefaultReaction,
|
selectDefaultReaction,
|
||||||
selectMaxUserReactions,
|
selectMaxUserReactions,
|
||||||
selectMessageIdsByGroupId,
|
selectMessageIdsByGroupId,
|
||||||
selectCurrentMessageList,
|
|
||||||
} from '../../selectors';
|
} from '../../selectors';
|
||||||
import { addMessageReaction, subtractXForEmojiInteraction, updateUnreadReactions } from '../../reducers/reactions';
|
import { addMessageReaction, subtractXForEmojiInteraction, updateUnreadReactions } from '../../reducers/reactions';
|
||||||
import {
|
import {
|
||||||
@ -159,17 +158,6 @@ addActionHandler('toggleReaction', (global, actions, payload): ActionReturnType
|
|||||||
return addMessageReaction(global, message, reactions);
|
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 => {
|
addActionHandler('stopActiveReaction', (global, actions, payload): ActionReturnType => {
|
||||||
const { messageId, reaction, tabId = getCurrentTabId() } = payload;
|
const { messageId, reaction, tabId = getCurrentTabId() } = payload;
|
||||||
|
|
||||||
|
|||||||
@ -34,14 +34,17 @@ addActionHandler('openChat', (global, actions, payload): ActionReturnType => {
|
|||||||
}, tabId);
|
}, tabId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currentMessageList
|
if (!currentMessageList || (
|
||||||
|| (
|
currentMessageList.chatId !== id
|
||||||
currentMessageList.chatId !== id
|
|| currentMessageList.threadId !== threadId
|
||||||
|| currentMessageList.threadId !== threadId
|
|| currentMessageList.type !== type
|
||||||
|| currentMessageList.type !== type
|
)) {
|
||||||
)) {
|
|
||||||
if (id) {
|
if (id) {
|
||||||
global = replaceTabThreadParam(global, id, threadId, 'replyStack', [], tabId);
|
global = replaceTabThreadParam(global, id, threadId, 'replyStack', [], tabId);
|
||||||
|
|
||||||
|
global = updateTabState(global, {
|
||||||
|
activeReactions: {},
|
||||||
|
}, tabId);
|
||||||
}
|
}
|
||||||
|
|
||||||
global = exitMessageSelectMode(global, tabId);
|
global = exitMessageSelectMode(global, tabId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user