From 0d14cb853e9248fe7fca179a2bb6cd6bd21b6fb2 Mon Sep 17 00:00:00 2001 From: Fred KISSIE Date: Tue, 16 Dec 2025 01:53:06 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20invalidate=20everything=20?= =?UTF-8?q?&=20fix=20use=20effect=20condition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proxy/[niceId]/authentication/page.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx b/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx index 8de6aa13..7ace8450 100644 --- a/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/[niceId]/authentication/page.tsx @@ -217,7 +217,7 @@ export default function ResourceAuthenticationPage() { const hasInitializedRef = useRef(false); useEffect(() => { - if (!pageLoading || hasInitializedRef.current) return; + if (pageLoading || hasInitializedRef.current) return; usersRolesForm.setValue( "roles", @@ -307,6 +307,17 @@ export default function ResourceAuthenticationPage() { title: t("resourceAuthSettingsSave"), description: t("resourceAuthSettingsSaveDescription") }); + await queryClient.invalidateQueries({ + predicate(query) { + const resourceKey = resourceQueries.resourceClients({ + resourceId: resource.resourceId + }).queryKey; + return ( + query.queryKey[0] === resourceKey[0] && + query.queryKey[1] === resourceKey[1] + ); + } + }); router.refresh(); } catch (e) { console.error(e);