Skip to content

Commit c311ea8

Browse files
ouiliameclaude
andcommitted
docs: stop the Ask AI stream when the panel is closed
Closing only hid the panel; useChat stayed mounted and the in-flight stream + searchDocs work kept consuming quota. Call stop() on close. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a50a8a0 commit c311ea8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/docs/components/ai/ask-ai.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ export function AskAI({ locale }: AskAIProps) {
102102
<button
103103
type='button'
104104
aria-label='Close'
105-
onClick={() => setOpen(false)}
105+
onClick={() => {
106+
stop()
107+
setOpen(false)
108+
}}
106109
className='flex size-7 items-center justify-center rounded-md text-[var(--text-icon)] transition-colors hover:bg-[var(--surface-active)]'
107110
>
108111
<X className='size-[16px]' />

0 commit comments

Comments
 (0)