feat: Simplify rendering logic in EndpointModelItem and optimize useEffect dependencies in Conversations component

This commit is contained in:
Marco Beretta
2025-11-24 21:23:20 +01:00
parent 960e2ee527
commit 16e9cd3e02
2 changed files with 3 additions and 4 deletions

View File

@@ -70,9 +70,7 @@ export function EndpointModelItem({ modelId, endpoint }: EndpointModelItemProps)
</div>
);
}
return (
<div className="flex h-5 w-5 flex-shrink-0 items-center justify-center overflow-hidden rounded-full" />
);
return null;
};
return (

View File

@@ -152,12 +152,13 @@ const Conversations: FC<ConversationsProps> = ({
useEffect(() => {
if (cache) {
// Only clear the favorites row
cache.clear(0, 0);
if (containerRef.current && 'recomputeRowHeights' in containerRef.current) {
containerRef.current.recomputeRowHeights(0);
}
}
}, [favorites, cache, containerRef]);
}, [favorites.length, cache, containerRef]);
const rowRenderer = useCallback(
({ index, key, parent, style }) => {