@@ -417,25 +446,7 @@ const LeftMainHeader: FC
= ({
onFocus={handleSearchFocus}
onSpinnerClick={connectionStatusPosition === 'minimized' ? toggleConnectionStatus : undefined}
>
- {selectedSearchDate && (
-
- )}
- {globalSearchChatId && (
-
- )}
+ {searchContent}
{isCurrentUserPremium && }
{hasPasscode && (
diff --git a/src/components/left/main/StatusPickerMenu.async.tsx b/src/components/left/main/StatusPickerMenu.async.tsx
index 328567f1f..fbd4e72ea 100644
--- a/src/components/left/main/StatusPickerMenu.async.tsx
+++ b/src/components/left/main/StatusPickerMenu.async.tsx
@@ -1,6 +1,5 @@
-import React, { memo } from '../../../lib/teact/teact';
-
import type { FC } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './StatusPickerMenu';
import { Bundles } from '../../../util/moduleLoader';
@@ -15,4 +14,4 @@ const StatusPickerMenuAsync: FC = (props) => {
return StatusPickerMenu ? : undefined;
};
-export default memo(StatusPickerMenuAsync);
+export default StatusPickerMenuAsync;
diff --git a/src/components/left/main/hooks/useChatListEntry.tsx b/src/components/left/main/hooks/useChatListEntry.tsx
index ff9fe102f..b033122ca 100644
--- a/src/components/left/main/hooks/useChatListEntry.tsx
+++ b/src/components/left/main/hooks/useChatListEntry.tsx
@@ -28,6 +28,7 @@ import { ChatAnimationTypes } from './useChatAnimationType';
import MessageSummary from '../../../common/MessageSummary';
import ChatForumLastMessage from '../../../common/ChatForumLastMessage';
import TypingStatus from '../../../common/TypingStatus';
+import useLastCallback from '../../../../hooks/useLastCallback';
const ANIMATION_DURATION = 200;
@@ -89,21 +90,7 @@ export default function useChatListEntry({
return actionTargetUserIds.map((userId) => usersById[userId]).filter(Boolean);
}, [actionTargetUserIds]);
- function renderSubtitle() {
- if (chat?.isForum && !isTopic) {
- return (
-
- );
- }
-
- return renderLastMessageOrTyping();
- }
-
- function renderLastMessageOrTyping() {
+ const renderLastMessageOrTyping = useLastCallback(() => {
if (typingStatus && lastMessage && typingStatus.timestamp > lastMessage.date * 1000) {
return ;
}
@@ -161,6 +148,20 @@ export default function useChatListEntry({
{renderSummary(lang, lastMessage, observeIntersection, mediaBlobUrl || mediaThumbnail, isRoundVideo)}
);
+ });
+
+ function renderSubtitle() {
+ if (chat?.isForum && !isTopic) {
+ return (
+
+ );
+ }
+
+ return renderLastMessageOrTyping();
}
// Sets animation excess values when `orderDiff` changes and then resets excess values to animate
diff --git a/src/components/left/newChat/NewChat.async.tsx b/src/components/left/newChat/NewChat.async.tsx
index c3390acee..c6f95f9a5 100644
--- a/src/components/left/newChat/NewChat.async.tsx
+++ b/src/components/left/newChat/NewChat.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import { Bundles } from '../../../util/moduleLoader';
import type { OwnProps } from './NewChat';
@@ -14,4 +14,4 @@ const NewChatAsync: FC = (props) => {
return NewChat ? : ;
};
-export default memo(NewChatAsync);
+export default NewChatAsync;
diff --git a/src/components/left/newChat/NewChatStep1.async.tsx b/src/components/left/newChat/NewChatStep1.async.tsx
index 25e807be4..23e54c53c 100644
--- a/src/components/left/newChat/NewChatStep1.async.tsx
+++ b/src/components/left/newChat/NewChatStep1.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import { Bundles } from '../../../util/moduleLoader';
import type { OwnProps } from './NewChatStep1';
@@ -14,4 +14,4 @@ const NewChatStep1Async: FC = (props) => {
return NewChatStep1 ? : ;
};
-export default memo(NewChatStep1Async);
+export default NewChatStep1Async;
diff --git a/src/components/left/newChat/NewChatStep2.async.tsx b/src/components/left/newChat/NewChatStep2.async.tsx
index 53b3697e3..3d1daf0cb 100644
--- a/src/components/left/newChat/NewChatStep2.async.tsx
+++ b/src/components/left/newChat/NewChatStep2.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import { Bundles } from '../../../util/moduleLoader';
import type { OwnProps } from './NewChatStep2';
@@ -14,4 +14,4 @@ const NewChatStep2Async: FC = (props) => {
return NewChatStep2 ? : ;
};
-export default memo(NewChatStep2Async);
+export default NewChatStep2Async;
diff --git a/src/components/left/search/LeftSearch.async.tsx b/src/components/left/search/LeftSearch.async.tsx
index 2e853cc24..8d1d496f4 100644
--- a/src/components/left/search/LeftSearch.async.tsx
+++ b/src/components/left/search/LeftSearch.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import { Bundles } from '../../../util/moduleLoader';
import type { OwnProps } from './LeftSearch';
@@ -13,4 +13,4 @@ const LeftSearchAsync: FC = (props) => {
return LeftSearch ? : ;
};
-export default memo(LeftSearchAsync);
+export default LeftSearchAsync;
diff --git a/src/components/left/settings/Settings.async.tsx b/src/components/left/settings/Settings.async.tsx
index f62935b16..8dc45ca07 100644
--- a/src/components/left/settings/Settings.async.tsx
+++ b/src/components/left/settings/Settings.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import { Bundles } from '../../../util/moduleLoader';
import type { OwnProps } from './Settings';
@@ -14,4 +14,4 @@ const SettingsAsync: FC = (props) => {
return Settings ? : ;
};
-export default memo(SettingsAsync);
+export default SettingsAsync;
diff --git a/src/components/main/AttachBotInstallModal.async.tsx b/src/components/main/AttachBotInstallModal.async.tsx
index 3381773b4..47d9db465 100644
--- a/src/components/main/AttachBotInstallModal.async.tsx
+++ b/src/components/main/AttachBotInstallModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './AttachBotInstallModal';
@@ -14,4 +14,4 @@ const AttachBotInstallModalAsync: FC = (props) => {
return AttachBotInstallModal ? : undefined;
};
-export default memo(AttachBotInstallModalAsync);
+export default AttachBotInstallModalAsync;
diff --git a/src/components/main/AttachBotRecipientPicker.async.tsx b/src/components/main/AttachBotRecipientPicker.async.tsx
index 6610e5845..a20cb6764 100644
--- a/src/components/main/AttachBotRecipientPicker.async.tsx
+++ b/src/components/main/AttachBotRecipientPicker.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './AttachBotRecipientPicker';
@@ -15,4 +15,4 @@ const AttachBotRecipientPickerAsync: FC = (props) => {
return AttachBotRecipientPicker ? : undefined;
};
-export default memo(AttachBotRecipientPickerAsync);
+export default AttachBotRecipientPickerAsync;
diff --git a/src/components/main/BotTrustModal.async.tsx b/src/components/main/BotTrustModal.async.tsx
index fd2770295..c309ab337 100644
--- a/src/components/main/BotTrustModal.async.tsx
+++ b/src/components/main/BotTrustModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './BotTrustModal';
@@ -14,4 +14,4 @@ const BotTrustModalAsync: FC = (props) => {
return BotTrustModal ? : undefined;
};
-export default memo(BotTrustModalAsync);
+export default BotTrustModalAsync;
diff --git a/src/components/main/DeleteFolderDialog.async.tsx b/src/components/main/DeleteFolderDialog.async.tsx
index cf7038732..7df199f6b 100644
--- a/src/components/main/DeleteFolderDialog.async.tsx
+++ b/src/components/main/DeleteFolderDialog.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './DeleteFolderDialog';
@@ -14,4 +14,4 @@ const DeleteFolderDialogAsync: FC = (props) => {
return DeleteFolderDialog ? : undefined;
};
-export default memo(DeleteFolderDialogAsync);
+export default DeleteFolderDialogAsync;
diff --git a/src/components/main/Dialogs.async.tsx b/src/components/main/Dialogs.async.tsx
index c26ab7c48..643496f7e 100644
--- a/src/components/main/Dialogs.async.tsx
+++ b/src/components/main/Dialogs.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import useModuleLoader from '../../hooks/useModuleLoader';
@@ -11,4 +11,4 @@ const DialogsAsync: FC = ({ isOpen }) => {
return Dialogs ? : undefined;
};
-export default memo(DialogsAsync);
+export default DialogsAsync;
diff --git a/src/components/main/DraftRecipientPicker.async.tsx b/src/components/main/DraftRecipientPicker.async.tsx
index d47b4d781..c157c7653 100644
--- a/src/components/main/DraftRecipientPicker.async.tsx
+++ b/src/components/main/DraftRecipientPicker.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './DraftRecipientPicker';
@@ -13,4 +13,4 @@ const DraftRecipientPickerAsync: FC = (props) => {
return DraftRecipientPicker ? : undefined;
};
-export default memo(DraftRecipientPickerAsync);
+export default DraftRecipientPickerAsync;
diff --git a/src/components/main/ForwardRecipientPicker.async.tsx b/src/components/main/ForwardRecipientPicker.async.tsx
index 3e27bae80..b188c5d09 100644
--- a/src/components/main/ForwardRecipientPicker.async.tsx
+++ b/src/components/main/ForwardRecipientPicker.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './ForwardRecipientPicker';
@@ -13,4 +13,4 @@ const ForwardRecipientPickerAsync: FC = (props) => {
return ForwardRecipientPicker ? : undefined;
};
-export default memo(ForwardRecipientPickerAsync);
+export default ForwardRecipientPickerAsync;
diff --git a/src/components/main/HistoryCalendar.async.tsx b/src/components/main/HistoryCalendar.async.tsx
index 7fcb5788c..65fb88ed5 100644
--- a/src/components/main/HistoryCalendar.async.tsx
+++ b/src/components/main/HistoryCalendar.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './HistoryCalendar';
@@ -14,4 +14,4 @@ const HistoryCalendarAsync: FC = (props) => {
return HistoryCalendar ? : undefined;
};
-export default memo(HistoryCalendarAsync);
+export default HistoryCalendarAsync;
diff --git a/src/components/main/LockScreen.async.tsx b/src/components/main/LockScreen.async.tsx
index aaeee70a8..bc59d261a 100644
--- a/src/components/main/LockScreen.async.tsx
+++ b/src/components/main/LockScreen.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './LockScreen';
@@ -14,4 +14,4 @@ const LockScreenAsync: FC = (props) => {
return LockScreen ? : undefined;
};
-export default memo(LockScreenAsync);
+export default LockScreenAsync;
diff --git a/src/components/main/Main.async.tsx b/src/components/main/Main.async.tsx
index e6e155863..f998c0ae3 100644
--- a/src/components/main/Main.async.tsx
+++ b/src/components/main/Main.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './Main';
@@ -13,4 +13,4 @@ const MainAsync: FC = (props) => {
return Main ? : undefined;
};
-export default memo(MainAsync);
+export default MainAsync;
diff --git a/src/components/main/NewContactModal.async.tsx b/src/components/main/NewContactModal.async.tsx
index 9d3af48c1..01cd22ca3 100644
--- a/src/components/main/NewContactModal.async.tsx
+++ b/src/components/main/NewContactModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './NewContactModal';
@@ -14,4 +14,4 @@ const NewContactModalAsync: FC = (props) => {
return NewContactModal ? : undefined;
};
-export default memo(NewContactModalAsync);
+export default NewContactModalAsync;
diff --git a/src/components/main/Notifications.async.tsx b/src/components/main/Notifications.async.tsx
index ceb7d2dbd..f3af3abbc 100644
--- a/src/components/main/Notifications.async.tsx
+++ b/src/components/main/Notifications.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import useModuleLoader from '../../hooks/useModuleLoader';
@@ -11,4 +11,4 @@ const NotificationsAsync: FC = ({ isOpen }) => {
return Notifications ? : undefined;
};
-export default memo(NotificationsAsync);
+export default NotificationsAsync;
diff --git a/src/components/main/SafeLinkModal.async.tsx b/src/components/main/SafeLinkModal.async.tsx
index d63c6f527..4d0fbda99 100644
--- a/src/components/main/SafeLinkModal.async.tsx
+++ b/src/components/main/SafeLinkModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './SafeLinkModal';
@@ -14,4 +14,4 @@ const SafeLinkModalAsync: FC = (props) => {
return SafeLinkModal ? : undefined;
};
-export default memo(SafeLinkModalAsync);
+export default SafeLinkModalAsync;
diff --git a/src/components/main/UrlAuthModal.async.tsx b/src/components/main/UrlAuthModal.async.tsx
index a3b131eb7..0886d33ba 100644
--- a/src/components/main/UrlAuthModal.async.tsx
+++ b/src/components/main/UrlAuthModal.async.tsx
@@ -1,7 +1,6 @@
-import React, { memo } from '../../lib/teact/teact';
-import { Bundles } from '../../util/moduleLoader';
-
import type { FC } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
+import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './UrlAuthModal';
import useModuleLoader from '../../hooks/useModuleLoader';
@@ -14,4 +13,4 @@ const UrlAuthModalAsync: FC = (props) => {
return UrlAuthModal ? : undefined;
};
-export default memo(UrlAuthModalAsync);
+export default UrlAuthModalAsync;
diff --git a/src/components/main/WebAppModal.async.tsx b/src/components/main/WebAppModal.async.tsx
index c3c35fa60..7f87d4b97 100644
--- a/src/components/main/WebAppModal.async.tsx
+++ b/src/components/main/WebAppModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './WebAppModal';
@@ -14,4 +14,4 @@ const WebAppModalAsync: FC = (props) => {
return WebAppModal ? : undefined;
};
-export default memo(WebAppModalAsync);
+export default WebAppModalAsync;
diff --git a/src/components/main/premium/GiftPremiumModal.async.tsx b/src/components/main/premium/GiftPremiumModal.async.tsx
index 1c5e0abd8..651b32bbe 100644
--- a/src/components/main/premium/GiftPremiumModal.async.tsx
+++ b/src/components/main/premium/GiftPremiumModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import { Bundles } from '../../../util/moduleLoader';
import type { OwnProps } from './GiftPremiumModal';
@@ -14,4 +14,4 @@ const GiftPremiumModalAsync: FC = (props) => {
return GiftPremiumModal ? : undefined;
};
-export default memo(GiftPremiumModalAsync);
+export default GiftPremiumModalAsync;
diff --git a/src/components/main/premium/PremiumMainModal.async.tsx b/src/components/main/premium/PremiumMainModal.async.tsx
index 6e8f40d02..38d8bce82 100644
--- a/src/components/main/premium/PremiumMainModal.async.tsx
+++ b/src/components/main/premium/PremiumMainModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import { Bundles } from '../../../util/moduleLoader';
import type { OwnProps } from './PremiumMainModal';
@@ -14,4 +14,4 @@ const PremiumMainModalAsync: FC = (props) => {
return PremiumMainModal ? : undefined;
};
-export default memo(PremiumMainModalAsync);
+export default PremiumMainModalAsync;
diff --git a/src/components/main/premium/common/PremiumLimitReachedModal.async.tsx b/src/components/main/premium/common/PremiumLimitReachedModal.async.tsx
index 585b16954..3d2b591fe 100644
--- a/src/components/main/premium/common/PremiumLimitReachedModal.async.tsx
+++ b/src/components/main/premium/common/PremiumLimitReachedModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../../lib/teact/teact';
-import React, { memo } from '../../../../lib/teact/teact';
+import React from '../../../../lib/teact/teact';
import { Bundles } from '../../../../util/moduleLoader';
import type { OwnProps } from './PremiumLimitReachedModal';
@@ -14,4 +14,4 @@ const PremiumLimitReachedModalAsync: FC = (props) => {
return PremiumLimitReachedModal ? : undefined;
};
-export default memo(PremiumLimitReachedModalAsync);
+export default PremiumLimitReachedModalAsync;
diff --git a/src/components/mediaViewer/MediaViewer.async.tsx b/src/components/mediaViewer/MediaViewer.async.tsx
index 39a07ac1a..4f7f47e57 100644
--- a/src/components/mediaViewer/MediaViewer.async.tsx
+++ b/src/components/mediaViewer/MediaViewer.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import useModuleLoader from '../../hooks/useModuleLoader';
@@ -14,4 +14,4 @@ const MediaViewerAsync: FC = ({ isOpen }) => {
return MediaViewer ? : undefined;
};
-export default memo(MediaViewerAsync);
+export default MediaViewerAsync;
diff --git a/src/components/middle/EmojiInteractionAnimation.async.tsx b/src/components/middle/EmojiInteractionAnimation.async.tsx
index 5b1a32ffb..9aa5d3eed 100644
--- a/src/components/middle/EmojiInteractionAnimation.async.tsx
+++ b/src/components/middle/EmojiInteractionAnimation.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import type { OwnProps } from './EmojiInteractionAnimation';
import { Bundles } from '../../util/moduleLoader';
@@ -15,4 +15,4 @@ const EmojiInteractionAnimationAsync: FC = (props) => {
return EmojiInteractionAnimation ? : undefined;
};
-export default memo(EmojiInteractionAnimationAsync);
+export default EmojiInteractionAnimationAsync;
diff --git a/src/components/middle/HeaderMenuContainer.async.tsx b/src/components/middle/HeaderMenuContainer.async.tsx
index 2e6a24bef..42a54d508 100644
--- a/src/components/middle/HeaderMenuContainer.async.tsx
+++ b/src/components/middle/HeaderMenuContainer.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import type { OwnProps } from './HeaderMenuContainer';
import { Bundles } from '../../util/moduleLoader';
@@ -13,4 +13,4 @@ const HeaderMenuContainerAsync: FC = (props) => {
return HeaderMenuContainer ? : undefined;
};
-export default memo(HeaderMenuContainerAsync);
+export default HeaderMenuContainerAsync;
diff --git a/src/components/middle/MessageLanguageModal.async.tsx b/src/components/middle/MessageLanguageModal.async.tsx
index 5e682ecf8..3cbbb42bb 100644
--- a/src/components/middle/MessageLanguageModal.async.tsx
+++ b/src/components/middle/MessageLanguageModal.async.tsx
@@ -1,6 +1,5 @@
-import React, { memo } from '../../lib/teact/teact';
-
import type { FC } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import type { OwnProps } from './MessageLanguageModal';
import { Bundles } from '../../util/moduleLoader';
@@ -14,4 +13,4 @@ const MessageLanguageModalAsync: FC = (props) => {
return MessageLanguageModal ? : undefined;
};
-export default memo(MessageLanguageModalAsync);
+export default MessageLanguageModalAsync;
diff --git a/src/components/middle/MessageSelectToolbar.async.tsx b/src/components/middle/MessageSelectToolbar.async.tsx
index e2b87e405..87ff4d812 100644
--- a/src/components/middle/MessageSelectToolbar.async.tsx
+++ b/src/components/middle/MessageSelectToolbar.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import { Bundles } from '../../util/moduleLoader';
import type { OwnProps } from './MessageSelectToolbar';
@@ -13,4 +13,4 @@ const MessageSelectToolbarAsync: FC = (props) => {
return MessageSelectToolbar ? : undefined;
};
-export default memo(MessageSelectToolbarAsync);
+export default MessageSelectToolbarAsync;
diff --git a/src/components/middle/MobileSearch.async.tsx b/src/components/middle/MobileSearch.async.tsx
index 4ec09dff6..1efd535df 100644
--- a/src/components/middle/MobileSearch.async.tsx
+++ b/src/components/middle/MobileSearch.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import type { OwnProps } from './MobileSearch';
import { Bundles } from '../../util/moduleLoader';
@@ -13,4 +13,4 @@ const MobileSearchAsync: FC = (props) => {
return MobileSearch ? : undefined;
};
-export default memo(MobileSearchAsync);
+export default MobileSearchAsync;
diff --git a/src/components/middle/ReactorListModal.async.tsx b/src/components/middle/ReactorListModal.async.tsx
index 87cb96d47..f2b993a18 100644
--- a/src/components/middle/ReactorListModal.async.tsx
+++ b/src/components/middle/ReactorListModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../lib/teact/teact';
-import React, { memo } from '../../lib/teact/teact';
+import React from '../../lib/teact/teact';
import type { OwnProps } from './ReactorListModal';
import { Bundles } from '../../util/moduleLoader';
@@ -13,4 +13,4 @@ const ReactorListModalAsync: FC = (props) => {
return ReactorListModal ? : undefined;
};
-export default memo(ReactorListModalAsync);
+export default ReactorListModalAsync;
diff --git a/src/components/middle/composer/AttachmentModal.async.tsx b/src/components/middle/composer/AttachmentModal.async.tsx
index 56dea4311..98f019d27 100644
--- a/src/components/middle/composer/AttachmentModal.async.tsx
+++ b/src/components/middle/composer/AttachmentModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './AttachmentModal';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const AttachmentModalAsync: FC = (props) => {
return AttachmentModal ? : undefined;
};
-export default memo(AttachmentModalAsync);
+export default AttachmentModalAsync;
diff --git a/src/components/middle/composer/BotCommandMenu.async.tsx b/src/components/middle/composer/BotCommandMenu.async.tsx
index 0a3db04bc..1f70dc671 100644
--- a/src/components/middle/composer/BotCommandMenu.async.tsx
+++ b/src/components/middle/composer/BotCommandMenu.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './BotCommandMenu';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const BotCommandMenuAsync: FC = (props) => {
return BotCommandMenu ? : undefined;
};
-export default memo(BotCommandMenuAsync);
+export default BotCommandMenuAsync;
diff --git a/src/components/middle/composer/BotCommandTooltip.async.tsx b/src/components/middle/composer/BotCommandTooltip.async.tsx
index 18720f630..720f969e1 100644
--- a/src/components/middle/composer/BotCommandTooltip.async.tsx
+++ b/src/components/middle/composer/BotCommandTooltip.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './BotCommandTooltip';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const BotCommandTooltipAsync: FC = (props) => {
return BotCommandTooltip ? : undefined;
};
-export default memo(BotCommandTooltipAsync);
+export default BotCommandTooltipAsync;
diff --git a/src/components/middle/composer/CustomEmojiTooltip.async.tsx b/src/components/middle/composer/CustomEmojiTooltip.async.tsx
index 27f721708..c9ffc01ac 100644
--- a/src/components/middle/composer/CustomEmojiTooltip.async.tsx
+++ b/src/components/middle/composer/CustomEmojiTooltip.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './CustomEmojiTooltip';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const CustomEmojiTooltipAsync: FC = (props) => {
return CustomEmojiTooltip ? : undefined;
};
-export default memo(CustomEmojiTooltipAsync);
+export default CustomEmojiTooltipAsync;
diff --git a/src/components/middle/composer/CustomSendMenu.async.tsx b/src/components/middle/composer/CustomSendMenu.async.tsx
index 5ceabe445..94c6938a6 100644
--- a/src/components/middle/composer/CustomSendMenu.async.tsx
+++ b/src/components/middle/composer/CustomSendMenu.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './CustomSendMenu';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const CustomSendMenuAsync: FC = (props) => {
return CustomSend ? : undefined;
};
-export default memo(CustomSendMenuAsync);
+export default CustomSendMenuAsync;
diff --git a/src/components/middle/composer/DropArea.async.tsx b/src/components/middle/composer/DropArea.async.tsx
index 63ea29812..a8976b095 100644
--- a/src/components/middle/composer/DropArea.async.tsx
+++ b/src/components/middle/composer/DropArea.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './DropArea';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,5 +13,5 @@ const DropAreaAsync: FC = (props) => {
return DropArea ? : undefined;
};
-export default memo(DropAreaAsync);
+export default DropAreaAsync;
export { DropAreaState } from './DropArea';
diff --git a/src/components/middle/composer/EmojiTooltip.async.tsx b/src/components/middle/composer/EmojiTooltip.async.tsx
index 10f909978..42efee355 100644
--- a/src/components/middle/composer/EmojiTooltip.async.tsx
+++ b/src/components/middle/composer/EmojiTooltip.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './EmojiTooltip';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const EmojiTooltipAsync: FC = (props) => {
return EmojiTooltip ? : undefined;
};
-export default memo(EmojiTooltipAsync);
+export default EmojiTooltipAsync;
diff --git a/src/components/middle/composer/InlineBotTooltip.async.tsx b/src/components/middle/composer/InlineBotTooltip.async.tsx
index bb4fa6e63..e50bad180 100644
--- a/src/components/middle/composer/InlineBotTooltip.async.tsx
+++ b/src/components/middle/composer/InlineBotTooltip.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './InlineBotTooltip';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const InlineBotTooltipAsync: FC = (props) => {
return InlineBotTooltip ? : undefined;
};
-export default memo(InlineBotTooltipAsync);
+export default InlineBotTooltipAsync;
diff --git a/src/components/middle/composer/MentionTooltip.async.tsx b/src/components/middle/composer/MentionTooltip.async.tsx
index 6edd27246..23fb0288a 100644
--- a/src/components/middle/composer/MentionTooltip.async.tsx
+++ b/src/components/middle/composer/MentionTooltip.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './MentionTooltip';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const MentionTooltipAsync: FC = (props) => {
return MentionTooltip ? : undefined;
};
-export default memo(MentionTooltipAsync);
+export default MentionTooltipAsync;
diff --git a/src/components/middle/composer/PollModal.async.tsx b/src/components/middle/composer/PollModal.async.tsx
index 8abdbfaca..5f578a7f7 100644
--- a/src/components/middle/composer/PollModal.async.tsx
+++ b/src/components/middle/composer/PollModal.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './PollModal';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const PollModalAsync: FC = (props) => {
return PollModal ? : undefined;
};
-export default memo(PollModalAsync);
+export default PollModalAsync;
diff --git a/src/components/middle/composer/SendAsMenu.async.tsx b/src/components/middle/composer/SendAsMenu.async.tsx
index bfc74d237..0d434c1c6 100644
--- a/src/components/middle/composer/SendAsMenu.async.tsx
+++ b/src/components/middle/composer/SendAsMenu.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './SendAsMenu';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const SendAsMenuAsync: FC = (props) => {
return SendAsMenu ? : undefined;
};
-export default memo(SendAsMenuAsync);
+export default SendAsMenuAsync;
diff --git a/src/components/middle/composer/StickerTooltip.async.tsx b/src/components/middle/composer/StickerTooltip.async.tsx
index 8b9188b65..b6444c39a 100644
--- a/src/components/middle/composer/StickerTooltip.async.tsx
+++ b/src/components/middle/composer/StickerTooltip.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './StickerTooltip';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const StickerTooltipAsync: FC = (props) => {
return StickerTooltip ? : undefined;
};
-export default memo(StickerTooltipAsync);
+export default StickerTooltipAsync;
diff --git a/src/components/middle/composer/SymbolMenu.async.tsx b/src/components/middle/composer/SymbolMenu.async.tsx
index bfa6ff6e2..c383f8a8c 100644
--- a/src/components/middle/composer/SymbolMenu.async.tsx
+++ b/src/components/middle/composer/SymbolMenu.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './SymbolMenu';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const SymbolMenuAsync: FC = (props) => {
return SymbolMenu ? : undefined;
};
-export default memo(SymbolMenuAsync);
+export default SymbolMenuAsync;
diff --git a/src/components/middle/composer/TextFormatter.async.tsx b/src/components/middle/composer/TextFormatter.async.tsx
index b4563cd07..8949e0a9d 100644
--- a/src/components/middle/composer/TextFormatter.async.tsx
+++ b/src/components/middle/composer/TextFormatter.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './TextFormatter';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const TextFormatterAsync: FC = (props) => {
return TextFormatter ? : undefined;
};
-export default memo(TextFormatterAsync);
+export default TextFormatterAsync;
diff --git a/src/components/middle/message/ContextMenuContainer.async.tsx b/src/components/middle/message/ContextMenuContainer.async.tsx
index b2120e6c0..b6c3ae885 100644
--- a/src/components/middle/message/ContextMenuContainer.async.tsx
+++ b/src/components/middle/message/ContextMenuContainer.async.tsx
@@ -1,5 +1,5 @@
import type { FC } from '../../../lib/teact/teact';
-import React, { memo } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './ContextMenuContainer';
import { Bundles } from '../../../util/moduleLoader';
@@ -13,4 +13,4 @@ const ContextMenuContainerAsync: FC = (props) => {
return ContextMenuContainer ? : undefined;
};
-export default memo(ContextMenuContainerAsync);
+export default ContextMenuContainerAsync;
diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx
index 957ab23fa..13e278973 100644
--- a/src/components/middle/message/Message.tsx
+++ b/src/components/middle/message/Message.tsx
@@ -1,93 +1,92 @@
+import type { FC } from '../../../lib/teact/teact';
import React, {
- memo,
- useEffect,
- useMemo,
- useRef,
- useState,
+ memo, useEffect, useMemo, useRef, useState,
} from '../../../lib/teact/teact';
import { getActions, withGlobal } from '../../../global';
-
-import type { FC } from '../../../lib/teact/teact';
import type {
- ActiveEmojiInteraction, ActiveReaction, ChatTranslatedMessages, MessageListType,
+ ActiveEmojiInteraction,
+ ActiveReaction,
+ ChatTranslatedMessages,
+ MessageListType,
} from '../../../global/types';
import type {
+ ApiAvailableReaction,
+ ApiChat,
+ ApiChatMember,
ApiMessage,
ApiMessageOutgoingStatus,
- ApiUser,
- ApiChat,
- ApiThreadInfo,
- ApiAvailableReaction,
- ApiChatMember,
- ApiUsername,
- ApiTopic,
ApiReaction,
ApiStickerSet,
+ ApiThreadInfo,
+ ApiTopic,
+ ApiUser,
+ ApiUsername,
} from '../../../api/types';
-import type { FocusDirection, IAlbum, ISettings } from '../../../types';
-import type { ObserveFn } from '../../../hooks/useIntersectionObserver';
-import type { PinnedIntersectionChangedCallback } from '../hooks/usePinnedMessage';
-import { AudioOrigin } from '../../../types';
import { MAIN_THREAD_ID } from '../../../api/types';
+import type { FocusDirection, IAlbum, ISettings } from '../../../types';
+import { AudioOrigin } from '../../../types';
+import type { ObserveFn } from '../../../hooks/useIntersectionObserver';
+import { useOnIntersect } from '../../../hooks/useIntersectionObserver';
+import type { PinnedIntersectionChangedCallback } from '../hooks/usePinnedMessage';
import { IS_ANDROID, IS_TOUCH_ENV } from '../../../util/windowEnvironment';
import { EMOJI_STATUS_LOOP_LIMIT, GENERAL_TOPIC_ID, IS_ELECTRON } from '../../../config';
import {
- selectChat,
- selectChatMessage,
- selectUploadProgress,
- selectIsChatWithSelf,
- selectOutgoingStatus,
- selectUser,
- selectIsMessageFocused,
- selectCurrentTextSearch,
- selectIsInSelectMode,
- selectIsMessageSelected,
- selectIsDocumentGroupSelected,
- selectSender,
- selectForwardedSender,
- selectThreadTopMessageId,
+ selectAllowedMessageActions,
+ selectAnimatedEmoji,
selectCanAutoLoadMedia,
selectCanAutoPlayMedia,
- selectShouldLoopStickers,
- selectTheme,
- selectAllowedMessageActions,
- selectIsDownloading,
- selectThreadInfo,
- selectMessageIdsByGroupId,
- selectIsMessageProtected,
- selectDefaultReaction,
- selectReplySender,
- selectAnimatedEmoji,
- selectIsCurrentUserPremium,
- selectIsChatProtected,
- selectTopicFromMessage,
- selectTabState,
- selectChatTranslations,
- selectRequestedTranslationLanguage,
+ selectChat,
selectChatFullInfo,
+ selectChatMessage,
+ selectChatTranslations,
+ selectCurrentTextSearch,
+ selectDefaultReaction,
+ selectForwardedSender,
+ selectIsChatProtected,
+ selectIsChatWithSelf,
+ selectIsCurrentUserPremium,
+ selectIsDocumentGroupSelected,
+ selectIsDownloading,
+ selectIsInSelectMode,
+ selectIsMessageFocused,
+ selectIsMessageProtected,
+ selectIsMessageSelected,
+ selectMessageIdsByGroupId,
+ selectOutgoingStatus,
selectPerformanceSettingsValue,
+ selectReplySender,
+ selectRequestedTranslationLanguage,
+ selectSender,
+ selectShouldLoopStickers,
+ selectTabState,
+ selectTheme,
+ selectThreadInfo,
+ selectThreadTopMessageId,
+ selectTopicFromMessage,
+ selectUploadProgress,
+ selectUser,
} from '../../../global/selectors';
import {
+ areReactionsEmpty,
getMessageContent,
- isOwnMessage,
- isReplyMessage,
- isAnonymousOwnMessage,
- isMessageLocal,
- isUserId,
- isChatWithRepliesBot,
getMessageCustomShape,
- isChatChannel,
+ getMessageHtmlId,
+ getMessageLocation,
+ getMessageSingleCustomEmoji,
getMessageSingleRegularEmoji,
getSenderTitle,
getUserColorKey,
- areReactionsEmpty,
- getMessageHtmlId,
- isGeoLiveExpired,
- getMessageSingleCustomEmoji,
hasMessageText,
+ isAnonymousOwnMessage,
+ isChatChannel,
isChatGroup,
- getMessageLocation,
+ isChatWithRepliesBot,
+ isGeoLiveExpired,
+ isMessageLocal,
+ isOwnMessage,
+ isReplyMessage,
+ isUserId,
} from '../../../global/helpers';
import buildClassName from '../../../util/buildClassName';
import {
@@ -98,8 +97,8 @@ import {
} from '../../common/helpers/mediaDimensions';
import { buildContentClassName } from './helpers/buildContentClassName';
import {
- getMinMediaWidth,
calculateMediaDimensions,
+ getMinMediaWidth,
MIN_MEDIA_WIDTH_WITH_TEXT,
} from './helpers/mediaDimensions';
import { calculateAlbumLayout } from './helpers/calculateAlbumLayout';
@@ -112,7 +111,6 @@ import { isAnimatingScroll } from '../../../util/animateScroll';
import useLastCallback from '../../../hooks/useLastCallback';
import useEnsureMessage from '../../../hooks/useEnsureMessage';
import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';
-import { useOnIntersect } from '../../../hooks/useIntersectionObserver';
import useLang from '../../../hooks/useLang';
import useShowTransition from '../../../hooks/useShowTransition';
import useFlag from '../../../hooks/useFlag';
@@ -802,7 +800,7 @@ const Message: FC = ({
);
}
- function renderQuickReactionButton() {
+ const renderQuickReactionButton = useLastCallback(() => {
if (!defaultReaction) return undefined;
return (
@@ -819,7 +817,7 @@ const Message: FC = ({
/>
);
- }
+ });
function renderReactionsAndMeta() {
const meta = (
diff --git a/src/components/middle/message/ReactionPicker.async.tsx b/src/components/middle/message/ReactionPicker.async.tsx
index a3aabf90c..d914e57fb 100644
--- a/src/components/middle/message/ReactionPicker.async.tsx
+++ b/src/components/middle/message/ReactionPicker.async.tsx
@@ -1,6 +1,5 @@
-import React, { memo } from '../../../lib/teact/teact';
-
import type { FC } from '../../../lib/teact/teact';
+import React from '../../../lib/teact/teact';
import type { OwnProps } from './ReactionPicker';
import { Bundles } from '../../../util/moduleLoader';
@@ -18,4 +17,4 @@ const ReactionPickerAsync: FC