mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-18 20:14:44 +08:00
fix: fix auto select first artifact
This commit is contained in:
@@ -74,14 +74,24 @@ export default function ChatPage() {
|
|||||||
return result;
|
return result;
|
||||||
}, [thread, isNewThread]);
|
}, [thread, isNewThread]);
|
||||||
|
|
||||||
|
const [autoSelectFirstArtifact, setAutoSelectFirstArtifact] = useState(true);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setArtifacts(thread.values.artifacts);
|
setArtifacts(thread.values.artifacts);
|
||||||
if (env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY === "true") {
|
if (
|
||||||
|
env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY === "true" &&
|
||||||
|
autoSelectFirstArtifact
|
||||||
|
) {
|
||||||
if (thread?.values?.artifacts?.length > 0) {
|
if (thread?.values?.artifacts?.length > 0) {
|
||||||
|
setAutoSelectFirstArtifact(false);
|
||||||
selectArtifact(thread.values.artifacts[0]!);
|
selectArtifact(thread.values.artifacts[0]!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [selectArtifact, setArtifacts, thread.values.artifacts]);
|
}, [
|
||||||
|
autoSelectFirstArtifact,
|
||||||
|
selectArtifact,
|
||||||
|
setArtifacts,
|
||||||
|
thread.values.artifacts,
|
||||||
|
]);
|
||||||
|
|
||||||
const [todoListCollapsed, setTodoListCollapsed] = useState(
|
const [todoListCollapsed, setTodoListCollapsed] = useState(
|
||||||
env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY !== "true",
|
env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY !== "true",
|
||||||
|
|||||||
Reference in New Issue
Block a user