From bb3ab6cba498fda7757a9988c4d8bd1b0fa1db69 Mon Sep 17 00:00:00 2001 From: "Adolfo R. Brandes" Date: Fri, 6 Mar 2026 19:26:43 -0300 Subject: [PATCH] perf: add staleTime to third-party auth context query The TPA context is effectively static per session. Adding a 5-minute staleTime prevents unnecessary background refetches when navigating between login/register tabs. Co-Authored-By: Claude Opus 4.6 --- src/common-components/data/apiHook.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common-components/data/apiHook.ts b/src/common-components/data/apiHook.ts index bd7517d3..97da0210 100644 --- a/src/common-components/data/apiHook.ts +++ b/src/common-components/data/apiHook.ts @@ -10,6 +10,7 @@ const useThirdPartyAuthHook = (pageId, payload) => useQuery({ queryKey: ThirdPartyAuthQueryKeys.byPage(pageId), queryFn: () => getThirdPartyAuthContext(payload), retry: false, + staleTime: 5 * 60 * 1000, // 5 minutes — TPA context is effectively static per session }); export {