From 344f12280cb480c7cf33097087f1e50e97fd771f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 18 Apr 2025 12:05:24 -0500 Subject: [PATCH] Improve queryClient options --- src/App.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index f16bc93..e040944 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,7 +13,15 @@ const defaultRelays = [ 'wss://ditto.pub/relay', ]; -const queryClient = new QueryClient(); +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + refetchOnWindowFocus: false, + staleTime: 60000, // 1 minute + gcTime: Infinity, + }, + }, +}); // NOTE: This file should normally not be modified unless you are adding a new provider. // To add new routes, edit the AppRouter.tsx file.