Fix infinite stacking All Media with shortcut
This commit is contained in:
parent
f52da976f9
commit
41e89554fe
1 changed files with 10 additions and 2 deletions
|
@ -5,6 +5,7 @@ import type { ThunkAction } from 'redux-thunk';
|
||||||
import {
|
import {
|
||||||
difference,
|
difference,
|
||||||
fromPairs,
|
fromPairs,
|
||||||
|
isEqual,
|
||||||
omit,
|
omit,
|
||||||
orderBy,
|
orderBy,
|
||||||
pick,
|
pick,
|
||||||
|
@ -2955,12 +2956,19 @@ function pushPanelForConversation(
|
||||||
panel: PanelRequestType
|
panel: PanelRequestType
|
||||||
): ThunkAction<void, RootStateType, unknown, PushPanelActionType> {
|
): ThunkAction<void, RootStateType, unknown, PushPanelActionType> {
|
||||||
return async (dispatch, getState) => {
|
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) {
|
if (panel.type === PanelType.MessageDetails) {
|
||||||
const { messageId } = panel.args;
|
const { messageId } = panel.args;
|
||||||
const state = getState();
|
|
||||||
|
|
||||||
const message =
|
const message =
|
||||||
state.conversations.messagesLookup[messageId] ||
|
conversations.messagesLookup[messageId] ||
|
||||||
(await __DEPRECATED$getMessageById(messageId))?.attributes;
|
(await __DEPRECATED$getMessageById(messageId))?.attributes;
|
||||||
if (!message) {
|
if (!message) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue