This commit is contained in:
msukkari 2025-07-27 21:17:36 -07:00
parent 3c0af96b18
commit 0e703f5314
2 changed files with 9 additions and 2 deletions

View file

@ -116,7 +116,7 @@ export const AskSourcebotDemoCards = ({
const context = demoExamples.searchContexts.find((context) => context.id === contextExample.searchContext) const context = demoExamples.searchContexts.find((context) => context.id === contextExample.searchContext)
if (!context) { if (!context) {
console.error(`Search context ${contextExample.searchContext} not found on handleContextClick`); console.error(`Search context ${contextExample.searchContext} not found on handleContextClick`);
return; return null;
} }
const isSelected = selectedItems.some( const isSelected = selectedItems.some(

View file

@ -51,7 +51,14 @@ export default async function Home({ params: { domain } }: { params: { domain: s
searchModeCookie?.value === "precise" searchModeCookie?.value === "precise"
) ? searchModeCookie.value : models.length > 0 ? "agentic" : "precise"; ) ? searchModeCookie.value : models.length > 0 ? "agentic" : "precise";
const demoExamples = env.SOURCEBOT_DEMO_EXAMPLES_PATH ? await loadJsonFile<DemoExamples>(env.SOURCEBOT_DEMO_EXAMPLES_PATH, demoExamplesSchema) : undefined; const demoExamples = env.SOURCEBOT_DEMO_EXAMPLES_PATH ? await (async () => {
try {
return await loadJsonFile<DemoExamples>(env.SOURCEBOT_DEMO_EXAMPLES_PATH!, demoExamplesSchema);
} catch (error) {
console.error('Failed to load demo examples:', error);
return undefined;
}
})() : undefined;
return ( return (
<div className="flex flex-col items-center overflow-hidden min-h-screen"> <div className="flex flex-col items-center overflow-hidden min-h-screen">