move artifacts into mask settings

This commit is contained in:
lloydzhou
2024-09-05 14:46:16 +08:00
parent b590d0857c
commit caf50b6e6c
7 changed files with 40 additions and 39 deletions

View File

@@ -19,7 +19,6 @@ import {
HTMLPreview,
HTMLPreviewHander,
} from "./artifacts";
import { ArtifactsPlugin } from "../constant";
import { useChatStore } from "../store";
import { IconButton } from "./button";
@@ -77,7 +76,6 @@ export function PreCode(props: { children: any }) {
const { height } = useWindowSize();
const chatStore = useChatStore();
const session = chatStore.currentSession();
const plugins = session.mask?.plugin;
const renderArtifacts = useDebouncedCallback(() => {
if (!ref.current) return;
@@ -94,10 +92,7 @@ export function PreCode(props: { children: any }) {
}
}, 600);
const enableArtifacts = useMemo(
() => plugins?.includes(ArtifactsPlugin.Artifacts),
[plugins],
);
const enableArtifacts = session.mask?.enableArtifacts !== false;
//Wrap the paragraph for plain-text
useEffect(() => {