From cc1a924c8bfea347c5d71173461fa69d4f474eae Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Thu, 1 Aug 2024 13:38:06 +0000 Subject: [PATCH] feat: use installationCompleted from useAutomatischInfo hook --- packages/web/src/components/InstallationForm/index.jsx | 2 +- packages/web/src/routes.jsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/web/src/components/InstallationForm/index.jsx b/packages/web/src/components/InstallationForm/index.jsx index a21eefda..07b5cac7 100644 --- a/packages/web/src/components/InstallationForm/index.jsx +++ b/packages/web/src/components/InstallationForm/index.jsx @@ -44,7 +44,7 @@ function InstallationForm() { const handleOnRedirect = () => { queryClient.invalidateQueries({ - queryKey: ['automatisch', 'config'], + queryKey: ['automatisch', 'info'], }); }; diff --git a/packages/web/src/routes.jsx b/packages/web/src/routes.jsx index 3c832d86..1f634275 100644 --- a/packages/web/src/routes.jsx +++ b/packages/web/src/routes.jsx @@ -29,14 +29,16 @@ import adminSettingsRoutes from './adminSettingsRoutes'; import Notifications from 'pages/Notifications'; import useAutomatischConfig from 'hooks/useAutomatischConfig'; import useAuthentication from 'hooks/useAuthentication'; +import useAutomatischInfo from 'hooks/useAutomatischInfo'; import Installation from 'pages/Installation'; function Routes() { - const { data: configData, isSuccess } = useAutomatischConfig(); + const { data: automatischInfo, isSuccess } = useAutomatischInfo(); + const { data: configData } = useAutomatischConfig(); const { isAuthenticated } = useAuthentication(); const config = configData?.data; - const installed = isSuccess ? config?.['installation.completed'] === true : true; + const installed = isSuccess ? automatischInfo.data.installationCompleted : true; const navigate = useNavigate(); useEffect(() => {