mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-20 04:30:17 +09:00
fix: 修复查看全部按钮导致artifacts失效
This commit is contained in:
parent
a6b14c7910
commit
cd49c12181
@ -79,6 +79,7 @@ export function PreCode(props: { children: any }) {
|
|||||||
setMermaidCode((mermaidDom as HTMLElement).innerText);
|
setMermaidCode((mermaidDom as HTMLElement).innerText);
|
||||||
}
|
}
|
||||||
const htmlDom = ref.current.querySelector("code.language-html");
|
const htmlDom = ref.current.querySelector("code.language-html");
|
||||||
|
const refText = ref.current?.innerText;
|
||||||
if (htmlDom) {
|
if (htmlDom) {
|
||||||
setHtmlCode((htmlDom as HTMLElement).innerText);
|
setHtmlCode((htmlDom as HTMLElement).innerText);
|
||||||
} else if (refText?.startsWith("<!DOCTYPE")) {
|
} else if (refText?.startsWith("<!DOCTYPE")) {
|
||||||
@ -86,11 +87,6 @@ export function PreCode(props: { children: any }) {
|
|||||||
}
|
}
|
||||||
}, 600);
|
}, 600);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setTimeout(renderArtifacts, 1);
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [refText]);
|
|
||||||
|
|
||||||
const enableArtifacts = useMemo(
|
const enableArtifacts = useMemo(
|
||||||
() => plugins?.includes(Plugin.Artifacts),
|
() => plugins?.includes(Plugin.Artifacts),
|
||||||
[plugins],
|
[plugins],
|
||||||
@ -119,6 +115,7 @@ export function PreCode(props: { children: any }) {
|
|||||||
codeElement.style.whiteSpace = "pre-wrap";
|
codeElement.style.whiteSpace = "pre-wrap";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
setTimeout(renderArtifacts, 1);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
@ -314,7 +314,9 @@ code{
|
|||||||
height: fit-content;
|
height: fit-content;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
pointer-events: none;
|
||||||
button{
|
button{
|
||||||
|
pointer-events: auto;
|
||||||
margin-top: 3em;
|
margin-top: 3em;
|
||||||
margin-bottom: 4em;
|
margin-bottom: 4em;
|
||||||
padding: 5px 16px;
|
padding: 5px 16px;
|
||||||
|
Loading…
Reference in New Issue
Block a user