mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-26 01:52:16 +08:00
fix(web): scope answer loading placeholder to the last message (#18284)
This commit is contained in:
@@ -142,7 +142,7 @@ const MarkdownContent = ({
|
||||
});
|
||||
|
||||
// let text = content;
|
||||
if (text === '') {
|
||||
if (text === '' && loading) {
|
||||
text = t('chat.searching');
|
||||
}
|
||||
const nextText = replaceTextByOldReg(text);
|
||||
|
||||
@@ -51,6 +51,7 @@ interface IProps extends Partial<IRemoveMessageById>, 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) ? (
|
||||
<LoadingDots className="text-text-secondary" />
|
||||
) : (
|
||||
<MarkdownContent
|
||||
|
||||
Reference in New Issue
Block a user