From d9917a81bbe0cc9b373c6290f57fa0ebd926f4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C4=B1dvan=20Akca?= Date: Fri, 12 Apr 2024 11:45:12 +0200 Subject: [PATCH] fix: invalidate app connections upon creating a connection --- packages/web/src/components/AddAppConnection/index.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/web/src/components/AddAppConnection/index.jsx b/packages/web/src/components/AddAppConnection/index.jsx index 41d72328..7c6f3e23 100644 --- a/packages/web/src/components/AddAppConnection/index.jsx +++ b/packages/web/src/components/AddAppConnection/index.jsx @@ -17,6 +17,7 @@ import useFormatMessage from 'hooks/useFormatMessage'; import { generateExternalLink } from 'helpers/translationValues'; import { Form } from './style'; import useAppAuth from 'hooks/useAppAuth'; +import { useQueryClient } from '@tanstack/react-query'; function AddAppConnection(props) { const { application, connectionId, onClose } = props; @@ -36,6 +37,7 @@ function AddAppConnection(props) { appAuthClientId, useShared: !!appAuthClientId, }); + const queryClient = useQueryClient(); React.useEffect(function relayProviderData() { if (window.opener) { @@ -78,6 +80,10 @@ function AddAppConnection(props) { const response = await authenticate({ fields: data, }); + + await queryClient.invalidateQueries({ + queryKey: ['apps', key, 'connections'], + }); onClose(response); } catch (err) { const error = err;