Fix infinite stacking All Media with shortcut

This commit is contained in:
ayumi-signal 2023-11-07 15:00:25 -08:00 committed by GitHub
parent f52da976f9
commit 41e89554fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ import type { ThunkAction } from 'redux-thunk';
import {
difference,
fromPairs,
isEqual,
omit,
orderBy,
pick,
@ -2955,12 +2956,19 @@ function pushPanelForConversation(
panel: PanelRequestType
): ThunkAction<void, RootStateType, unknown, PushPanelActionType> {
return async (dispatch, getState) => {
const { conversations } = getState();
const { targetedConversationPanels } = conversations;
const activePanel =
targetedConversationPanels.stack[targetedConversationPanels.watermark];
if (panel.type === activePanel?.type && isEqual(panel, activePanel)) {
return;
}
if (panel.type === PanelType.MessageDetails) {
const { messageId } = panel.args;
const state = getState();
const message =
state.conversations.messagesLookup[messageId] ||
conversations.messagesLookup[messageId] ||
(await __DEPRECATED$getMessageById(messageId))?.attributes;
if (!message) {
throw new Error(