mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-18 00:15:30 +01:00
fix: Add key prop to MeasuredRow components in Conversations for improved rendering
- Updated MeasuredRow components to include a key prop for better performance and to prevent rendering issues during list updates. - Ensured consistent handling of item types within the Conversations component.
This commit is contained in:
parent
cd3b141e3c
commit
c96f8997fe
1 changed files with 5 additions and 5 deletions
|
|
@ -250,7 +250,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
|
||||
if (item.type === 'loading') {
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<LoadingSpinner />
|
||||
</MeasuredRow>
|
||||
);
|
||||
|
|
@ -258,7 +258,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
|
||||
if (item.type === 'favorites') {
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<FavoritesList
|
||||
isSmallScreen={isSmallScreen}
|
||||
toggleNav={toggleNav}
|
||||
|
|
@ -270,7 +270,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
|
||||
if (item.type === 'chats-header') {
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<ChatsHeader
|
||||
isExpanded={isChatsExpanded}
|
||||
onToggle={() => setIsChatsExpanded(!isChatsExpanded)}
|
||||
|
|
@ -285,7 +285,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
// Without favorites: [chats-header, first-header] → index 1
|
||||
const firstHeaderIndex = shouldShowFavorites ? 2 : 1;
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<DateLabel groupName={item.groupName} isFirst={index === firstHeaderIndex} />
|
||||
</MeasuredRow>
|
||||
);
|
||||
|
|
@ -293,7 +293,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
|
||||
if (item.type === 'convo') {
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<MemoizedConvo conversation={item.convo} retainView={moveToTop} toggleNav={toggleNav} />
|
||||
</MeasuredRow>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue