Skip to content

Commit 0e703f5

Browse files
committed
feedback
1 parent 3c0af96 commit 0e703f5

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

packages/web/src/app/[domain]/components/homepage/askSourcebotDemoCards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const AskSourcebotDemoCards = ({
116116
const context = demoExamples.searchContexts.find((context) => context.id === contextExample.searchContext)
117117
if (!context) {
118118
console.error(`Search context ${contextExample.searchContext} not found on handleContextClick`);
119-
return;
119+
return null;
120120
}
121121

122122
const isSelected = selectedItems.some(

packages/web/src/app/[domain]/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ export default async function Home({ params: { domain } }: { params: { domain: s
5151
searchModeCookie?.value === "precise"
5252
) ? searchModeCookie.value : models.length > 0 ? "agentic" : "precise";
5353

54-
const demoExamples = env.SOURCEBOT_DEMO_EXAMPLES_PATH ? await loadJsonFile<DemoExamples>(env.SOURCEBOT_DEMO_EXAMPLES_PATH, demoExamplesSchema) : undefined;
54+
const demoExamples = env.SOURCEBOT_DEMO_EXAMPLES_PATH ? await (async () => {
55+
try {
56+
return await loadJsonFile<DemoExamples>(env.SOURCEBOT_DEMO_EXAMPLES_PATH!, demoExamplesSchema);
57+
} catch (error) {
58+
console.error('Failed to load demo examples:', error);
59+
return undefined;
60+
}
61+
})() : undefined;
5562

5663
return (
5764
<div className="flex flex-col items-center overflow-hidden min-h-screen">

0 commit comments

Comments
 (0)