Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(frontend): delays in updating conversation titles before they are reflected in the user interface. (#11558)

Hiep Le31702bf46ba1
diff --git a/frontend/src/hooks/mutation/use-update-conversation.ts b/frontend/src/hooks/mutation/use-update-conversation.ts
index 051ab0ec28..8b6cedc311 100644
--- a/frontend/src/hooks/mutation/use-update-conversation.ts
+++ b/frontend/src/hooks/mutation/use-update-conversation.ts
@@ -26,6 +26,13 @@ export const useUpdateConversation = () => {
),
);
+ // Also optimistically update the active conversation query
+ queryClient.setQueryData(
+ ["user", "conversation", variables.conversationId],
+ (old: { title: string } | undefined) =>
+ old ? { ...old, title: variables.newTitle } : old,
+ );
+
return { previousConversations };
},
onError: (err, variables, context) => {