[Perf] Message List: Consider heavy animation in getIsMessageListReady

This commit is contained in:
Alexander Zinchuk 2024-09-06 15:42:32 +02:00
parent d0d1a57cf3
commit 08ad256c70

View File

@ -12,7 +12,11 @@ import { MAIN_THREAD_ID } from '../../api/types';
import { SCHEDULED_WHEN_ONLINE } from '../../config';
import {
getMessageHtmlId, getMessageOriginalId, isActionMessage, isOwnMessage, isServiceNotificationMessage,
getMessageHtmlId,
getMessageOriginalId,
isActionMessage,
isOwnMessage,
isServiceNotificationMessage,
} from '../../global/helpers';
import buildClassName from '../../util/buildClassName';
import { formatHumanDate } from '../../util/dates/dateFormat';
@ -21,6 +25,7 @@ import { isAlbum } from './helpers/groupMessages';
import { preventMessageInputBlur } from './helpers/preventMessageInputBlur';
import useDerivedSignal from '../../hooks/useDerivedSignal';
import { getIsHeavyAnimating } from '../../hooks/useHeavyAnimationCheck';
import useOldLang from '../../hooks/useOldLang';
import usePrevious from '../../hooks/usePrevious';
import useMessageObservers from './hooks/useMessageObservers';
@ -94,7 +99,9 @@ const MessageListContent: FC<OwnProps> = ({
}) => {
const { openHistoryCalendar } = getActions();
const getIsReady = useDerivedSignal(isReady);
const getIsHeavyAnimating2 = getIsHeavyAnimating;
const getIsReady = useDerivedSignal(() => isReady && !getIsHeavyAnimating2(), [isReady, getIsHeavyAnimating2]);
const areDatesClickable = !isSavedDialog && !isSchedule;
const {