From d21af3b5d77d77dc38e8f04f371b88a3060ce613 Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Wed, 23 Apr 2025 18:59:06 +0200 Subject: [PATCH] Bot Info: Fix logic preventing it from showing up (#5828) --- .../middle/MessageListAccountInfo.module.scss | 1 + .../middle/MessageListAccountInfo.tsx | 23 +------------------ src/components/middle/MessageListContent.tsx | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/components/middle/MessageListAccountInfo.module.scss b/src/components/middle/MessageListAccountInfo.module.scss index a534810c9..cf0fae1cb 100644 --- a/src/components/middle/MessageListAccountInfo.module.scss +++ b/src/components/middle/MessageListAccountInfo.module.scss @@ -13,6 +13,7 @@ flex-direction: column; font-size: calc(var(--message-text-size, 1rem) - 0.0625rem); + font-weight: var(--font-weight-normal); border-radius: var(--border-radius-messages); overflow: hidden; text-align: center; diff --git a/src/components/middle/MessageListAccountInfo.tsx b/src/components/middle/MessageListAccountInfo.tsx index 76ef4eb2b..a5dd3ba03 100644 --- a/src/components/middle/MessageListAccountInfo.tsx +++ b/src/components/middle/MessageListAccountInfo.tsx @@ -3,7 +3,6 @@ import React, { memo, useEffect, useMemo, - useRef, } from '../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../global'; @@ -30,12 +29,10 @@ import { getCountryCodeByIso } from '../../util/phoneNumber'; import stopEvent from '../../util/stopEvent'; import renderText from '../common/helpers/renderText'; -import useEffectOnce from '../../hooks/useEffectOnce'; import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMedia from '../../hooks/useMedia'; import useOldLang from '../../hooks/useOldLang'; -import useShowTransition from '../../hooks/useShowTransition'; import AvatarList from '../common/AvatarList'; import Icon from '../common/icons/Icon'; @@ -65,7 +62,6 @@ const MessageListAccountInfo: FC = ({ chatId, botInfo, isLoadingFullUser, - isInMessageList, phoneCodeList, commonChats, userFullInfo, @@ -168,25 +164,8 @@ const MessageListAccountInfo: FC = ({ return entries; }, [lang, oldLang, country, registrationMonth, commonChats, userFullInfo]); - const isEmptyOrLoading = (isBotInfoEmpty && isChatInfoEmpty) || isLoadingFullUser; - - const isFirstRenderRef = useRef(true); - const { - shouldRender, - ref, - } = useShowTransition({ - isOpen: !isEmptyOrLoading && isInMessageList, - withShouldRender: true, - }); - - useEffectOnce(() => { - isFirstRenderRef.current = false; - }); - - if (!shouldRender) return undefined; - return ( -
+
{isLoadingFullUser && isChatInfoEmpty && {oldLang('Loading')}} {(isBotInfoEmpty && isChatInfoEmpty) && !isLoadingFullUser && {oldLang('NoMessages')}} {botInfo && ( diff --git a/src/components/middle/MessageListContent.tsx b/src/components/middle/MessageListContent.tsx index b6fee041f..91021b064 100644 --- a/src/components/middle/MessageListContent.tsx +++ b/src/components/middle/MessageListContent.tsx @@ -372,7 +372,7 @@ const MessageListContent: FC = ({
{withHistoryTriggers &&
} {shouldRenderAccountInfo - && } + && } {dateGroups.flat()} {withHistoryTriggers && (