From 2a6debb587c904df67b9d6ca6f58d06af8871cf3 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 13 Sep 2022 09:48:11 +0200 Subject: [PATCH] [Perf] Chat List: Speed up opening --- src/components/left/main/Chat.tsx | 2 +- src/components/middle/MiddleHeader.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/left/main/Chat.tsx b/src/components/left/main/Chat.tsx index 0ea5f036b..db328caec 100644 --- a/src/components/left/main/Chat.tsx +++ b/src/components/left/main/Chat.tsx @@ -189,7 +189,7 @@ const Chat: FC = ({ }, [animationLevel, orderDiff, animationType]); const handleClick = useCallback(() => { - openChat({ id: chatId, shouldReplaceHistory: true }); + openChat({ id: chatId, shouldReplaceHistory: true }, { forceOnHeavyAnimation: true }); if (isSelected && canScrollDown) { focusLastMessage(); diff --git a/src/components/middle/MiddleHeader.tsx b/src/components/middle/MiddleHeader.tsx index b50ead720..7f3d60bd2 100644 --- a/src/components/middle/MiddleHeader.tsx +++ b/src/components/middle/MiddleHeader.tsx @@ -208,7 +208,7 @@ const MiddleHeader: FC = ({ if (threadId === MAIN_THREAD_ID && messageListType === 'thread' && currentTransitionKey === 0) { if (IS_SINGLE_COLUMN_LAYOUT || shouldShowCloseButton) { e.stopPropagation(); // Stop propagation to prevent chat re-opening on tablets - openChat({ id: undefined }); + openChat({ id: undefined }, { forceOnHeavyAnimation: true }); } else { toggleLeftColumn(); }