mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-10 05:39:11 +00:00
Filter out any undefined agents when rendering the home page
This commit is contained in:
@@ -111,18 +111,20 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
|||||||
setAgents(agents);
|
setAgents(agents);
|
||||||
|
|
||||||
//generate colored icons for the selected agents
|
//generate colored icons for the selected agents
|
||||||
const agentIcons = agents.map(
|
const agentIcons = agents
|
||||||
(agent) =>
|
.filter((agent) => agent !== null && agent !== undefined)
|
||||||
getIconFromIconName(agent.icon, agent.color) || (
|
.map(
|
||||||
<Image
|
(agent) =>
|
||||||
key={agent.name}
|
getIconFromIconName(agent.icon, agent.color) || (
|
||||||
src={agent.avatar}
|
<Image
|
||||||
alt={agent.name}
|
key={agent.name}
|
||||||
width={50}
|
src={agent.avatar}
|
||||||
height={50}
|
alt={agent.name}
|
||||||
/>
|
width={50}
|
||||||
),
|
height={50}
|
||||||
);
|
/>
|
||||||
|
),
|
||||||
|
);
|
||||||
setAgentIcons(agentIcons);
|
setAgentIcons(agentIcons);
|
||||||
}, [agentsData, props.isMobileWidth]);
|
}, [agentsData, props.isMobileWidth]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user