diff --git a/web/src/components/markdown-content/index.tsx b/web/src/components/markdown-content/index.tsx index 55f0284c1b..b4913d3441 100644 --- a/web/src/components/markdown-content/index.tsx +++ b/web/src/components/markdown-content/index.tsx @@ -142,7 +142,7 @@ const MarkdownContent = ({ }); // let text = content; - if (text === '') { + if (text === '' && loading) { text = t('chat.searching'); } const nextText = replaceTextByOldReg(text); diff --git a/web/src/components/message-item/index.tsx b/web/src/components/message-item/index.tsx index c56841c5a4..a51cab3246 100644 --- a/web/src/components/message-item/index.tsx +++ b/web/src/components/message-item/index.tsx @@ -51,6 +51,7 @@ interface IProps extends Partial, IRegenerateMessage { index: number; showLikeButton?: boolean; showLoudspeaker?: boolean; + isLast?: boolean; } const MessageItem = ({ @@ -68,6 +69,7 @@ const MessageItem = ({ showLoudspeaker = true, visibleAvatar = true, nickname, + isLast = false, }: IProps) => { const { theme } = useTheme(); const isAssistant = item.role === MessageType.Assistant; @@ -164,7 +166,7 @@ const MessageItem = ({ { '!bg-bg-card': !isAssistant }, )} > - {sendLoading && isEmpty(messageContent) ? ( + {sendLoading && isLast && isEmpty(messageContent) ? ( ) : ( { derivedMessages?.length - 1 === i } index={i} + isLast={i === derivedMessages.length - 1} clickDocumentButton={clickDocumentButton} showLikeButton={false} showLoudspeaker={false}