mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-04 23:30:19 +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') {
|
if (item.type === 'loading') {
|
||||||
return (
|
return (
|
||||||
<MeasuredRow {...rowProps}>
|
<MeasuredRow key={key} {...rowProps}>
|
||||||
<LoadingSpinner />
|
<LoadingSpinner />
|
||||||
</MeasuredRow>
|
</MeasuredRow>
|
||||||
);
|
);
|
||||||
|
|
@ -258,7 +258,7 @@ const Conversations: FC<ConversationsProps> = ({
|
||||||
|
|
||||||
if (item.type === 'favorites') {
|
if (item.type === 'favorites') {
|
||||||
return (
|
return (
|
||||||
<MeasuredRow {...rowProps}>
|
<MeasuredRow key={key} {...rowProps}>
|
||||||
<FavoritesList
|
<FavoritesList
|
||||||
isSmallScreen={isSmallScreen}
|
isSmallScreen={isSmallScreen}
|
||||||
toggleNav={toggleNav}
|
toggleNav={toggleNav}
|
||||||
|
|
@ -270,7 +270,7 @@ const Conversations: FC<ConversationsProps> = ({
|
||||||
|
|
||||||
if (item.type === 'chats-header') {
|
if (item.type === 'chats-header') {
|
||||||
return (
|
return (
|
||||||
<MeasuredRow {...rowProps}>
|
<MeasuredRow key={key} {...rowProps}>
|
||||||
<ChatsHeader
|
<ChatsHeader
|
||||||
isExpanded={isChatsExpanded}
|
isExpanded={isChatsExpanded}
|
||||||
onToggle={() => setIsChatsExpanded(!isChatsExpanded)}
|
onToggle={() => setIsChatsExpanded(!isChatsExpanded)}
|
||||||
|
|
@ -285,7 +285,7 @@ const Conversations: FC<ConversationsProps> = ({
|
||||||
// Without favorites: [chats-header, first-header] → index 1
|
// Without favorites: [chats-header, first-header] → index 1
|
||||||
const firstHeaderIndex = shouldShowFavorites ? 2 : 1;
|
const firstHeaderIndex = shouldShowFavorites ? 2 : 1;
|
||||||
return (
|
return (
|
||||||
<MeasuredRow {...rowProps}>
|
<MeasuredRow key={key} {...rowProps}>
|
||||||
<DateLabel groupName={item.groupName} isFirst={index === firstHeaderIndex} />
|
<DateLabel groupName={item.groupName} isFirst={index === firstHeaderIndex} />
|
||||||
</MeasuredRow>
|
</MeasuredRow>
|
||||||
);
|
);
|
||||||
|
|
@ -293,7 +293,7 @@ const Conversations: FC<ConversationsProps> = ({
|
||||||
|
|
||||||
if (item.type === 'convo') {
|
if (item.type === 'convo') {
|
||||||
return (
|
return (
|
||||||
<MeasuredRow {...rowProps}>
|
<MeasuredRow key={key} {...rowProps}>
|
||||||
<MemoizedConvo conversation={item.convo} retainView={moveToTop} toggleNav={toggleNav} />
|
<MemoizedConvo conversation={item.convo} retainView={moveToTop} toggleNav={toggleNav} />
|
||||||
</MeasuredRow>
|
</MeasuredRow>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue