fix: prevent stale loading state on previous agent chat reply (#18124)

This commit is contained in:
chanx
2026-08-12 09:36:45 +08:00
committed by GitHub
parent a0e091e750
commit e195a25972

View File

@@ -107,7 +107,8 @@ function AgentChatBox() {
loading={
message.role === MessageType.Assistant &&
sendLoading &&
derivedMessages.length - 1 === i
derivedMessages.length - 1 === i &&
!message.content
}
key={buildMessageUuidWithRole(message)}
nickname={userInfo.nickname}
@@ -118,7 +119,7 @@ function AgentChatBox() {
clickDocumentButton={clickDocumentButton}
index={i}
showLikeButton={false}
sendLoading={sendLoading}
sendLoading={sendLoading && derivedMessages.length - 1 === i}
>
{message.role === MessageType.Assistant &&
derivedMessages.length - 1 === i && (