Skip to content

An AI-powered search engine with a generative UI

fix: Update Chat component to fix search path condition

Yoshiki Miuraf45eda55de2d
diff --git a/components/chat.tsx b/components/chat.tsx
index 2ace4575..62956602 100644
--- a/components/chat.tsx
+++ b/components/chat.tsx
@@ -18,7 +18,7 @@ export function Chat({ id, query }: ChatProps) {
useEffect(() => {
if (
(!path.includes('search') && messages.length === 1) ||
- (path.includes('/search') && query && messages.length === 1)
+ (path.includes('/search?q=') && query && messages.length === 1)
) {
window.history.replaceState({}, '', `/search/${id}`)
}