mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-24 14:44:46 +08:00
fix: fix renaming
This commit is contained in:
@@ -74,12 +74,6 @@ export function useSubmitThread({
|
|||||||
async (message: PromptInputMessage) => {
|
async (message: PromptInputMessage) => {
|
||||||
const text = message.text.trim();
|
const text = message.text.trim();
|
||||||
|
|
||||||
console.log('[useSubmitThread] Submitting message:', {
|
|
||||||
text,
|
|
||||||
hasFiles: !!message.files?.length,
|
|
||||||
filesCount: message.files?.length || 0
|
|
||||||
});
|
|
||||||
|
|
||||||
// Upload files first if any
|
// Upload files first if any
|
||||||
if (message.files && message.files.length > 0) {
|
if (message.files && message.files.length > 0) {
|
||||||
try {
|
try {
|
||||||
@@ -204,11 +198,17 @@ export function useRenameThread() {
|
|||||||
threadId: string;
|
threadId: string;
|
||||||
title: string;
|
title: string;
|
||||||
}) => {
|
}) => {
|
||||||
await apiClient.threads.update(threadId, {
|
await apiClient.threads.updateState(threadId, {
|
||||||
metadata: { title },
|
values: { title },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onSuccess(_, { threadId, title }) {
|
onSuccess(_, { threadId, title }) {
|
||||||
|
queryClient.setQueryData(
|
||||||
|
["thread", "state", threadId],
|
||||||
|
(oldData: Array<AgentThread>) => {
|
||||||
|
console.info("oldData", oldData);
|
||||||
|
},
|
||||||
|
);
|
||||||
queryClient.setQueriesData(
|
queryClient.setQueriesData(
|
||||||
{
|
{
|
||||||
queryKey: ["threads", "search"],
|
queryKey: ["threads", "search"],
|
||||||
@@ -219,8 +219,8 @@ export function useRenameThread() {
|
|||||||
if (t.thread_id === threadId) {
|
if (t.thread_id === threadId) {
|
||||||
return {
|
return {
|
||||||
...t,
|
...t,
|
||||||
metadata: {
|
values: {
|
||||||
...t.metadata,
|
...t.values,
|
||||||
title,
|
title,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user