mirror of https://github.com/langgenius/dify.git
fix: Don't hide chat streaming loader on '\n' content (#26829)
This commit is contained in:
parent
c71fd7113c
commit
c6a90d4bb3
|
|
@ -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} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue