From 462968780d9b75018e28ad2d25a86c737616013d Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Thu, 4 Dec 2025 09:13:40 -0800 Subject: [PATCH] fix: correct query removal call sequence in when changing organization --- .../layouts/OrganizationLayout/components/NavBar/Navbar.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx index 4610546cb9..dfc2fb6034 100644 --- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx +++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx @@ -183,9 +183,6 @@ export const Navbar = () => { }, [subscription, isBillingPage, isModalIntrusive]); const handleOrgChange = async (orgId: string) => { - queryClient.removeQueries({ queryKey: authKeys.getAuthToken }); - queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() }); - const { token, isMfaEnabled, mfaMethod } = await selectOrganization({ organizationId: orgId }); @@ -202,6 +199,8 @@ export const Navbar = () => { await router.invalidate(); await navigateUserToOrg(navigate, orgId); queryClient.removeQueries({ queryKey: subOrgQuery.queryKey }); + queryClient.removeQueries({ queryKey: authKeys.getAuthToken }); + queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() }); }; const { mutateAsync } = useGetOrgTrialUrl();