Skip to content

An AI-powered search engine with a generative UI

Remove unused code and fix redirect in ChatPanel

Yoshiki Miura130ad2f275c8
diff --git a/app/new/page.tsx b/app/new/page.tsx
deleted file mode 100644
index d2358948..00000000
--- a/app/new/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { redirect } from 'next/navigation'
-
-export default async function NewPage() {
- redirect('/')
-}
diff --git a/components/chat-panel.tsx b/components/chat-panel.tsx
index 8d75fc15..93d95142 100644
--- a/components/chat-panel.tsx
+++ b/components/chat-panel.tsx
@@ -56,7 +56,7 @@ export function ChatPanel({ messages }: ChatPanelProps) {
// Clear messages
const handleClear = () => {
- router.push('/new')
+ router.push('/')
}
useEffect(() => {
diff --git a/components/chat.tsx b/components/chat.tsx
index 84201f64..6a7c937a 100644
--- a/components/chat.tsx
+++ b/components/chat.tsx
@@ -23,12 +23,9 @@ export function Chat({ id }: ChatProps) {
}, [id, path, messages])
useEffect(() => {
- console.log('aiState', aiState.messages[aiState.messages.length - 1]?.type)
if (aiState.messages[aiState.messages.length - 1]?.type === 'followup') {
// Refresh the page to chat history updates
- setTimeout(() => {
- router.refresh()
- }, 1000)
+ router.refresh()
}
}, [aiState, router])