✨ feat: Simplify rendering logic in EndpointModelItem and optimize useEffect dependencies in Conversations component
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user