From d708ac7c044c8cf5aefb04726cac3866eed6b089 Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Thu, 11 Jan 2024 11:06:36 -0300 Subject: [PATCH] fix(site): remove refetch on windows focus (#11574) It causes the sign-in page to reload whenever a user enters a page or changes the window's focus. This is happening because when the "user" fetch is made, the server returns an error, making the react-query mark the data as stale and try to load it whenever possible. --- site/src/api/queries/users.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/site/src/api/queries/users.ts b/site/src/api/queries/users.ts index 7f265b1c0f..0249315071 100644 --- a/site/src/api/queries/users.ts +++ b/site/src/api/queries/users.ts @@ -131,7 +131,6 @@ export const me = (): UseQueryOptions & { queryKey: meKey, initialData: initialUserData, queryFn: API.getAuthenticatedUser, - refetchOnWindowFocus: true, }; };