From 85f70e5e2038e1589e7b6d63d3d04ebb4c9fd46a Mon Sep 17 00:00:00 2001 From: Piyush Gupta Date: Mon, 24 Nov 2025 20:21:30 +0530 Subject: [PATCH] fix: query invalidation --- .../layouts/OrganizationLayout/components/NavBar/Navbar.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx index 49e5a66eb..93d08f9ca 100644 --- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx +++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx @@ -196,8 +196,6 @@ export const Navbar = () => { const breadcrumbs = matches && "breadcrumbs" in matches ? matches.breadcrumbs : undefined; const handleOrgChange = async (orgId: string, onSuccess?: () => void | Promise) => { - queryClient.removeQueries({ queryKey: authKeys.getAuthToken }); - const { token, isMfaEnabled, mfaMethod } = await selectOrganization({ organizationId: orgId }); @@ -216,6 +214,7 @@ export const Navbar = () => { SecurityClient.setToken(token); SecurityClient.setProviderAuthToken(""); + queryClient.removeQueries({ queryKey: authKeys.getAuthToken }); queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() }); await router.invalidate(); @@ -244,8 +243,6 @@ export const Navbar = () => { }; const handleSubOrgChange = async (subOrgId: string) => { - queryClient.removeQueries({ queryKey: authKeys.getAuthToken }); - const { token, isMfaEnabled, mfaMethod } = await selectSubOrganization({ subOrganizationId: subOrgId }); @@ -265,6 +262,7 @@ export const Navbar = () => { SecurityClient.setToken(token); SecurityClient.setProviderAuthToken(""); + queryClient.removeQueries({ queryKey: authKeys.getAuthToken }); queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() }); await router.invalidate(); navigate({