Skip to content

Commit

Permalink
fix(Featured agents): Featured agents when thrown error is handled an…
Browse files Browse the repository at this point in the history
…d we can still navigate and see the other agents segment
  • Loading branch information
wadhia-yash committed Sep 16, 2024
1 parent 036f96d commit 2bb6a14
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,22 @@
})
]);
const existingAgents = await existingResponse.json();
const newAgents = await newResponse.json();
let existingAgents = await existingResponse.json();
let newAgents = await newResponse.json();
debugger
if (!existingResponse.ok && !newResponse.ok) {
throw new Error("Failed to fetch agents");
}
if (!newResponse.ok) {
newAgents = [];
}
agents = existingAgents;
filteredAgents = existingAgents;
debugger;
// Combine agents from new API into sections
sections = newAgents;
Expand Down

0 comments on commit 2bb6a14

Please sign in to comment.