feat: refactor document fetching and improve comment batching

- Replaced the useDocuments hook with React Query for better caching and deduplication of document requests.
- Updated the ConnectorIndicator component to fetch document type counts using a new atom for real-time updates.
- Enhanced the useComments hook to manage batch requests more effectively, reducing race conditions and improving performance.
- Set default query options in the query client to optimize stale time and refetch behavior.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-02-28 01:54:54 -08:00
parent cc0d8ad4d7
commit 1bb9f479e1
4 changed files with 80 additions and 57 deletions

View file

@ -1,3 +1,10 @@
import { QueryClient } from "@tanstack/react-query";
export const queryClient = new QueryClient();
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 30_000,
refetchOnWindowFocus: false,
},
},
});