Skip to content

Commit

Permalink
fix: defensive frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemarsden committed Nov 7, 2024
1 parent e5d15c5 commit f463821
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/components/apps/AppsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ const AppsDataGrid: FC<React.PropsWithChildren<{

const tableData = useMemo(() => {
return data.map(app => {
const gptScripts = (app.config.helix?.assistants[0]?.gptscripts || [])
const apiTools = (app.config.helix?.assistants[0]?.tools || []).filter(t => t.tool_type == 'api')
const assistant = app.config.helix?.assistants?.[0]
const gptScripts = assistant?.gptscripts || []
const apiTools = (assistant?.tools || []).filter(t => t.tool_type == 'api')

const gptscriptsElem = gptScripts.length > 0 ? (
<>
Expand Down

0 comments on commit f463821

Please sign in to comment.