fix new message send stay bottom

This commit is contained in:
2024-12-14 18:06:40 +02:00
parent 1da9fb161e
commit dc7e0db0d8
4 changed files with 37 additions and 28 deletions

View File

@@ -39,11 +39,10 @@ export const ChatList = ({
const scrollingIntervalRef = useRef(null);
const lastSeenUnreadMessageTimestamp = useRef(null);
// Initialize the virtualizer
const rowVirtualizer = useVirtualizer({
count: messages.length,
getItemKey: (index) => messages[index].signature,
getItemKey: (index) => messages[index]?.tempSignature || messages[index].signature,
getScrollElement: () => parentRef?.current,
estimateSize: useCallback(() => 80, []), // Provide an estimated height of items, adjust this as needed
overscan: 10, // Number of items to render outside the visible area to improve smoothness