Close canvas while streaming (#500)

This commit is contained in:
Jeremy 2024-11-07 01:14:11 +03:00 committed by GitHub
parent 24fdf181bc
commit 6801f3a236
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 8 deletions

View file

@ -56,9 +56,11 @@ export function useCanvasStream({
...draftCanvas,
content: draftCanvas.content + (delta.content as string),
isVisible:
draftCanvas.status === 'streaming'
draftCanvas.status === 'streaming' &&
draftCanvas.content.length > 200 &&
draftCanvas.content.length < 250
? true
: draftCanvas.content.length > 200,
: draftCanvas.isVisible,
status: 'streaming',
};