mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 05:37:20 +08:00
fix(frontend): sub-conversation ids are missing when navigating from the conversation panel (#12506)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { useInfiniteQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useInfiniteQuery } from "@tanstack/react-query";
|
||||
import ConversationService from "#/api/conversation-service/conversation-service.api";
|
||||
import { useIsAuthed } from "./use-is-authed";
|
||||
|
||||
export const usePaginatedConversations = (limit: number = 20) => {
|
||||
const { data: userIsAuthenticated } = useIsAuthed();
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useInfiniteQuery({
|
||||
queryKey: ["user", "conversations", "paginated", limit],
|
||||
@@ -14,14 +13,6 @@ export const usePaginatedConversations = (limit: number = 20) => {
|
||||
pageParam,
|
||||
);
|
||||
|
||||
// Optimistically populate individual conversation caches
|
||||
result.results.forEach((conversation) => {
|
||||
queryClient.setQueryData(
|
||||
["user", "conversation", conversation.conversation_id],
|
||||
conversation,
|
||||
);
|
||||
});
|
||||
|
||||
return result;
|
||||
},
|
||||
enabled: !!userIsAuthenticated,
|
||||
|
||||
Reference in New Issue
Block a user