fix: Don't hide chat streaming loader on '\n' content (#26829)

This commit is contained in:
Davide Delbianco 2025-10-13 11:31:52 +02:00 committed by GitHub
parent c71fd7113c
commit c6a90d4bb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -111,6 +111,8 @@ const Answer: FC<AnswerProps> = ({
} }
}, [switchSibling, item.prevSibling, item.nextSibling]) }, [switchSibling, item.prevSibling, item.nextSibling])
const contentIsEmpty = content.trim() === ''
return ( return (
<div className='mb-2 flex last:mb-0'> <div className='mb-2 flex last:mb-0'>
<div className='relative h-10 w-10 shrink-0'> <div className='relative h-10 w-10 shrink-0'>
@ -153,14 +155,14 @@ const Answer: FC<AnswerProps> = ({
) )
} }
{ {
responding && !content && !hasAgentThoughts && ( responding && contentIsEmpty && !hasAgentThoughts && (
<div className='flex h-5 w-6 items-center justify-center'> <div className='flex h-5 w-6 items-center justify-center'>
<LoadingAnim type='text' /> <LoadingAnim type='text' />
</div> </div>
) )
} }
{ {
content && !hasAgentThoughts && ( !contentIsEmpty && !hasAgentThoughts && (
<BasicContent item={item} /> <BasicContent item={item} />
) )
} }