diff --git a/frontend/src/components/AuthPage/SignIn/BasicSignIn/BasicSignIn.tsx b/frontend/src/components/AuthPage/SignIn/BasicSignIn/BasicSignIn.tsx index 29a56b75f..e283d4eac 100644 --- a/frontend/src/components/AuthPage/SignIn/BasicSignIn/BasicSignIn.tsx +++ b/frontend/src/components/AuthPage/SignIn/BasicSignIn/BasicSignIn.tsx @@ -5,9 +5,9 @@ import { Controller, FormProvider, useForm } from 'react-hook-form'; import { useAuthenticate } from 'lib/hooks/api/appConfig'; import AlertIcon from 'components/common/Icons/AlertIcon'; import { useNavigate } from 'react-router-dom'; +import { useQueryClient } from '@tanstack/react-query'; import * as S from './BasicSignIn.styled'; -import { useQueryClient } from '@tanstack/react-query'; interface FormValues { username: string; @@ -28,7 +28,7 @@ function BasicSignIn() { if (response.raw.url.includes('error')) { methods.setError('root', { message: 'error' }); } else { - await client.invalidateQueries({queryKey: ['app', 'info']}); + await client.invalidateQueries({ queryKey: ['app', 'info'] }); navigate('/'); } }, diff --git a/frontend/src/components/contexts/GlobalSettingsContext.tsx b/frontend/src/components/contexts/GlobalSettingsContext.tsx index a0e51ae9c..aa6202bf7 100644 --- a/frontend/src/components/contexts/GlobalSettingsContext.tsx +++ b/frontend/src/components/contexts/GlobalSettingsContext.tsx @@ -27,14 +27,14 @@ export const GlobalSettingsProvider: React.FC< return; } - const features = info?.data?.response.enabledFeatures + const features = info?.data?.response.enabledFeatures; if (features) { setValue({ hasDynamicConfig: features.includes( ApplicationInfoEnabledFeaturesEnum.DYNAMIC_CONFIG ), - }) + }); } }, [info.data]); diff --git a/frontend/src/lib/hooks/api/appConfig.ts b/frontend/src/lib/hooks/api/appConfig.ts index bc2491b32..a91c6eb4b 100644 --- a/frontend/src/lib/hooks/api/appConfig.ts +++ b/frontend/src/lib/hooks/api/appConfig.ts @@ -28,24 +28,21 @@ export function useAuthenticate() { } export function useAppInfo() { - return useQuery( - ['app', 'info'], - async () => { - const data = await appConfig.getApplicationInfoRaw() + return useQuery(['app', 'info'], async () => { + const data = await appConfig.getApplicationInfoRaw(); - let response: ApplicationInfo = {} - try { - response = await data.value() - } catch { - response = {} - } + let response: ApplicationInfo = {}; + try { + response = await data.value(); + } catch { + response = {}; + } - return { - redirect: data.raw.url.includes('auth'), - response, - } - }, - ); + return { + redirect: data.raw.url.includes('auth'), + response, + }; + }); } export function useAppConfig() {