mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
fix: Prevent duplicate API calls when reopening conversation panel
When the conversation panel was closed and reopened, TanStack Query's useInfiniteQuery would refetch all cached pages, causing multiple API calls. This fix adds staleTime of 5 minutes to prevent unnecessary refetches when the data is still fresh. This is consistent with other hooks in the codebase that use the same staleTime value. Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
parent
7bd9a7f8b7
commit
da4b1e1a88
@ -27,5 +27,6 @@ export const usePaginatedConversations = (limit: number = 20) => {
|
||||
enabled: !!userIsAuthenticated,
|
||||
getNextPageParam: (lastPage) => lastPage.next_page_id,
|
||||
initialPageParam: undefined as string | undefined,
|
||||
staleTime: 1000 * 60 * 5, // 5 minutes - prevents unnecessary refetches when reopening panel
|
||||
});
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user