Merge branch 'dhk-1' of http://192.168.0.200/knowledge-base-bj/deerflow-server into dhk-1
This commit is contained in:
commit
8751ee7361
2 files changed
+771
-761
No files matched your search
@@ -133,8 +133,18 @@ export function useUpdateArtifactContent() {
|
|||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: updateArtifactContent,
|
mutationFn: updateArtifactContent,
|
||||||
onSuccess: (content, variables) => {
|
onSuccess: (content, variables) => {
|
||||||
queryClient.setQueryData(
|
// useArtifactContent 的查询键带第 5 个元素 publicShareCode,这里用前缀
|
||||||
["artifact", variables.filepath, variables.threadId, variables.isMock],
|
// 过滤(setQueriesData)匹配,避免精确键缺少 publicShareCode 写到幽灵缓存、
|
||||||
|
// 导致保存后内容被旧缓存重置回原值。
|
||||||
|
queryClient.setQueriesData(
|
||||||
|
{
|
||||||
|
queryKey: [
|
||||||
|
"artifact",
|
||||||
|
variables.filepath,
|
||||||
|
variables.threadId,
|
||||||
|
variables.isMock,
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
content,
|
content,
|
||||||
url: undefined,
|
url: undefined,
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user