diff --git a/components/AtlasChat.tsx b/components/AtlasChat.tsx index a4f9af9..a48ae58 100644 --- a/components/AtlasChat.tsx +++ b/components/AtlasChat.tsx @@ -16,7 +16,8 @@ interface AtlasChatProps { // --------------------------------------------------------------------------- // Markdown-lite renderer — handles **bold**, newlines, numbered/bullet lists // --------------------------------------------------------------------------- -function renderContent(text: string) { +function renderContent(text: string | null | undefined) { + if (!text) return null; return text.split("\n").map((line, i) => { const parts = line.split(/(\*\*.*?\*\*)/g).map((seg, j) => seg.startsWith("**") && seg.endsWith("**") @@ -205,7 +206,8 @@ export function AtlasChat({ projectId }: AtlasChatProps) { } }; - const isEmpty = messages.length === 0 && !isStreaming; + const visibleMessages = messages.filter(msg => msg.content); + const isEmpty = visibleMessages.length === 0 && !isStreaming; return (