diff --git a/app/actions.ts b/app/actions.ts
index cb28bf5..3d40e88 100644
--- a/app/actions.ts
+++ b/app/actions.ts
@@ -5,7 +5,11 @@ import { kv } from '@vercel/kv'
import { type Chat } from '@/lib/types'
-export async function getChats(userId: string) {
+export async function getChats(userId?: string | null) {
+ if (!userId) {
+ return []
+ }
+
try {
const pipeline = kv.pipeline()
const chats: string[] = await kv.zrange(`user:chat:${userId}`, 0, -1)
diff --git a/components/chat-panel.tsx b/components/chat-panel.tsx
index c184c70..6189500 100644
--- a/components/chat-panel.tsx
+++ b/components/chat-panel.tsx
@@ -32,7 +32,7 @@ export function ChatPanel({
onClick={() => stop()}
className="bg-background"
>
-
+
Open source AI chatbot app built with{' '}
+ {props?.session?.user ? (
+ <>No chat history>
+ ) : (
+ <>Login for history>
+ )}
+
- {session?.user ? <>No chat history> : <>Login for history>}
-