From 9b0863e123305cb87a11acc4544d05226c9a20a5 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Thu, 25 Jul 2024 17:26:28 -0500 Subject: [PATCH] quickfixes --- apps/web/app/(dash)/home/history.tsx | 7 ++++++- apps/web/app/actions/doers.ts | 2 +- apps/web/app/layout.tsx | 11 ++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/web/app/(dash)/home/history.tsx b/apps/web/app/(dash)/home/history.tsx index 307ef4e3..057330ac 100644 --- a/apps/web/app/(dash)/home/history.tsx +++ b/apps/web/app/(dash)/home/history.tsx @@ -21,7 +21,12 @@ const History = memo(({ setQuery }: { setQuery: (q: string) => void }) => { } console.log(suggestions); if (typeof suggestions.data === "string") { - setSuggestions(JSON.parse(suggestions.data)); + const queries = suggestions.data.slice(1, -1).split(", "); + const parsedQueries = queries.map((query) => + query.replace(/^'|'$/g, ""), + ); + console.log(parsedQueries); + setSuggestions(parsedQueries); return; } setSuggestions(suggestions.data.reverse().slice(0, 3)); diff --git a/apps/web/app/actions/doers.ts b/apps/web/app/actions/doers.ts index fbccd195..029c7b0f 100644 --- a/apps/web/app/actions/doers.ts +++ b/apps/web/app/actions/doers.ts @@ -784,7 +784,7 @@ export async function getQuerySuggestions() { messages: [ { role: "system", - content: `You are a model that suggests questions based on the user's content. you MUST suggest atleast 1 question to ask. Create 3 suggestions at most.`, + content: `You are a model that suggests questions based on the user's content. you MUST suggest atleast 1 question to ask. AT MAX, create 3 suggestions. not more than that.`, }, { role: "user", diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index cf6e9b0f..94a538ed 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -66,9 +66,14 @@ export default function RootLayout({ }): JSX.Element { return ( - {/* - - */} + + {/* Cloudflare web analytics */} + + {/* TODO: when lightmode support is added, remove the 'dark' class from the body tag */}