Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

Davide Delbiancoc6a90d4bb39d
diff --git a/web/app/components/base/chat/chat/answer/index.tsx b/web/app/components/base/chat/chat/answer/index.tsx
index 51eb00cfc58..a1b458ba9a0 100644
--- a/web/app/components/base/chat/chat/answer/index.tsx
+++ b/web/app/components/base/chat/chat/answer/index.tsx
@@ -111,6 +111,8 @@ const Answer: FC<AnswerProps> = ({
}
}, [switchSibling, item.prevSibling, item.nextSibling])
+ const contentIsEmpty = content.trim() === ''
+
return (
<div className='mb-2 flex last:mb-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'>
<LoadingAnim type='text' />
</div>
)
}
{
- content && !hasAgentThoughts && (
+ !contentIsEmpty && !hasAgentThoughts && (
<BasicContent item={item} />
)
}