An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
Remove unused code and fix redirect in ChatPanel
Yoshiki Miura130ad2f275c8
diff --git a/app/new/page.tsx b/app/new/page.tsxdeleted file mode 100644index 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.tsxindex 8d75fc15..93d95142 100644--- a/components/chat-panel.tsx+++ b/components/chat-panel.tsx@@ -56,7 +56,7 @@ export function ChatPanel({ messages }: ChatPanelProps) {// Clear messagesconst handleClear = () => {- router.push('/new')+ router.push('/')}useEffect(() => {diff --git a/components/chat.tsx b/components/chat.tsxindex 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])