Filter out any undefined agents when rendering the home page

This commit is contained in:
sabaimran
2024-08-10 13:33:55 +05:30
parent acf1c14122
commit 1d581464e6

View File

@@ -111,7 +111,9 @@ 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
.filter((agent) => agent !== null && agent !== undefined)
.map(
(agent) => (agent) =>
getIconFromIconName(agent.icon, agent.color) || ( getIconFromIconName(agent.icon, agent.color) || (
<Image <Image