mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-24 07:26:47 +08:00
### What problem does this PR solve? Fix: The form waiting for input is not displayed in the dialog message. #12129 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -134,6 +134,51 @@ function MessageItem({
|
||||
},
|
||||
[currentEventListWithoutMessageById, loading],
|
||||
);
|
||||
|
||||
const renderContent = useCallback(() => {
|
||||
/* Show message content if there's any text besides the download */
|
||||
|
||||
if (pdfDownloadInfo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn({
|
||||
[theme === 'dark' ? styles.messageTextDark : styles.messageText]:
|
||||
isAssistant,
|
||||
[styles.messageUserText]: !isAssistant,
|
||||
'bg-bg-card': !isAssistant,
|
||||
})}
|
||||
>
|
||||
{item.data ? (
|
||||
children
|
||||
) : sendLoading && isEmpty(messageContent) ? (
|
||||
<>{!isShare && 'running...'}</>
|
||||
) : (
|
||||
<MarkdownContent
|
||||
loading={loading}
|
||||
content={messageContent}
|
||||
reference={reference}
|
||||
clickDocumentButton={clickDocumentButton}
|
||||
></MarkdownContent>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}, [
|
||||
children,
|
||||
clickDocumentButton,
|
||||
isAssistant,
|
||||
isShare,
|
||||
item.data,
|
||||
loading,
|
||||
messageContent,
|
||||
pdfDownloadInfo,
|
||||
reference,
|
||||
sendLoading,
|
||||
theme,
|
||||
]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classNames(styles.messageItem, {
|
||||
@ -239,6 +284,7 @@ function MessageItem({
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Show PDF download button if download info is present */}
|
||||
{pdfDownloadInfo && (
|
||||
<PDFDownloadButton
|
||||
@ -247,31 +293,8 @@ function MessageItem({
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Show message content if there's any text besides the download */}
|
||||
{messageContent && (
|
||||
<div
|
||||
className={cn({
|
||||
[theme === 'dark'
|
||||
? styles.messageTextDark
|
||||
: styles.messageText]: isAssistant,
|
||||
[styles.messageUserText]: !isAssistant,
|
||||
'bg-bg-card': !isAssistant,
|
||||
})}
|
||||
>
|
||||
{item.data ? (
|
||||
children
|
||||
) : sendLoading && isEmpty(messageContent) ? (
|
||||
<>{!isShare && 'running...'}</>
|
||||
) : (
|
||||
<MarkdownContent
|
||||
loading={loading}
|
||||
content={messageContent}
|
||||
reference={reference}
|
||||
clickDocumentButton={clickDocumentButton}
|
||||
></MarkdownContent>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{renderContent()}
|
||||
|
||||
{isAssistant && referenceDocuments.length > 0 && (
|
||||
<ReferenceDocumentList
|
||||
list={referenceDocuments}
|
||||
|
||||
Reference in New Issue
Block a user