mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-03 11:05:30 +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],
|
[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 (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames(styles.messageItem, {
|
className={classNames(styles.messageItem, {
|
||||||
@ -239,6 +284,7 @@ function MessageItem({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Show PDF download button if download info is present */}
|
{/* Show PDF download button if download info is present */}
|
||||||
{pdfDownloadInfo && (
|
{pdfDownloadInfo && (
|
||||||
<PDFDownloadButton
|
<PDFDownloadButton
|
||||||
@ -247,31 +293,8 @@ function MessageItem({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Show message content if there's any text besides the download */}
|
{renderContent()}
|
||||||
{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>
|
|
||||||
)}
|
|
||||||
{isAssistant && referenceDocuments.length > 0 && (
|
{isAssistant && referenceDocuments.length > 0 && (
|
||||||
<ReferenceDocumentList
|
<ReferenceDocumentList
|
||||||
list={referenceDocuments}
|
list={referenceDocuments}
|
||||||
|
|||||||
Reference in New Issue
Block a user