Improve timeline rendering performance

This commit is contained in:
trevor-signal 2024-02-27 11:01:25 -05:00 committed by GitHub
parent c319a089d2
commit 167b2f4f1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 329 additions and 106 deletions

View file

@ -7,9 +7,8 @@ import { useSelector } from 'react-redux';
import { TypingBubble } from '../../components/conversation/TypingBubble';
import { useGlobalModalActions } from '../ducks/globalModals';
import { useProxySelector } from '../../hooks/useProxySelector';
import { getIntl, getTheme } from '../selectors/user';
import { getTimelineItem } from '../selectors/timeline';
import { useTimelineItem } from '../selectors/timeline';
import {
getConversationSelector,
getConversationMessagesSelector,
@ -37,7 +36,7 @@ export function SmartTypingBubble({
conversationId
);
const lastMessageId = last(conversationMessages.items);
const lastItem = useProxySelector(getTimelineItem, lastMessageId);
const lastItem = useTimelineItem(lastMessageId, conversationId);
let lastItemAuthorId: string | undefined;
let lastItemTimestamp: number | undefined;
if (lastItem?.data) {