mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
fix(Content.jsx): remove 'z-index: 1;' from currentContent variable
fix(Content.jsx): exclude rehypePlugins if isIFrame is true fix(Content.jsx): update content rendering to use currentContent variable
This commit is contained in:
parent
712be248be
commit
3a112a344d
1 changed files with 7 additions and 4 deletions
|
|
@ -33,6 +33,8 @@ const Content = React.memo(({ content, message }) => {
|
||||||
const latestMessage = useRecoilValue(store.latestMessage);
|
const latestMessage = useRecoilValue(store.latestMessage);
|
||||||
const isInitializing = content === '<span className="result-streaming">█</span>';
|
const isInitializing = content === '<span className="result-streaming">█</span>';
|
||||||
const isLatestMessage = message?.messageId === latestMessage?.messageId;
|
const isLatestMessage = message?.messageId === latestMessage?.messageId;
|
||||||
|
const currentContent = content?.replace('z-index: 1;', '') ?? '';
|
||||||
|
const isIFrame = currentContent.includes('<iframe');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let timer1, timer2;
|
let timer1, timer2;
|
||||||
|
|
@ -68,9 +70,8 @@ const Content = React.memo(({ content, message }) => {
|
||||||
[rehypeRaw],
|
[rehypeRaw],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!isInitializing || !isLatestMessage) {
|
if ((!isInitializing || !isLatestMessage) && !isIFrame) {
|
||||||
//commented out to fix bing image creator errors
|
rehypePlugins.pop();
|
||||||
//rehypePlugins.pop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -83,7 +84,9 @@ const Content = React.memo(({ content, message }) => {
|
||||||
p,
|
p,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isLatestMessage && isSubmitting && !isInitializing ? (content ?? '') + cursor : content}
|
{isLatestMessage && isSubmitting && !isInitializing
|
||||||
|
? currentContent + cursor
|
||||||
|
: currentContent}
|
||||||
</ReactMarkdown>
|
</ReactMarkdown>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue