From 462a03fe8a4048b544b6f13903353e27a4c81b7a Mon Sep 17 00:00:00 2001 From: khuddite Date: Wed, 13 Nov 2024 17:12:54 -0500 Subject: [PATCH] code enhancements --- .../src/modules/app/components/AppRouterProviders.tsx | 5 +---- .../client-config/components/ClientConfigProviderEffect.tsx | 5 +++-- packages/twenty-ui/src/display/index.ts | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx b/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx index 4afa4d005219..ae0ff0a139b2 100644 --- a/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx +++ b/packages/twenty-front/src/modules/app/components/AppRouterProviders.tsx @@ -5,7 +5,6 @@ import { AuthProvider } from '@/auth/components/AuthProvider'; import { ChromeExtensionSidecarEffect } from '@/chrome-extension-sidecar/components/ChromeExtensionSidecarEffect'; import { ChromeExtensionSidecarProvider } from '@/chrome-extension-sidecar/components/ChromeExtensionSidecarProvider'; import { ClientConfigProviderEffect } from '@/client-config/components/ClientConfigProviderEffect'; -import { isClientConfigLoadedState } from '@/client-config/states/isClientConfigLoadedState'; import { PromiseRejectionEffect } from '@/error-handler/components/PromiseRejectionEffect'; import { ApolloMetadataClientProvider } from '@/object-metadata/components/ApolloMetadataClientProvider'; import { ObjectMetadataItemsProvider } from '@/object-metadata/components/ObjectMetadataItemsProvider'; @@ -19,17 +18,14 @@ import { UserProvider } from '@/users/components/UserProvider'; import { UserProviderEffect } from '@/users/components/UserProviderEffect'; import { StrictMode } from 'react'; import { Outlet, useLocation } from 'react-router-dom'; -import { useRecoilState } from 'recoil'; import { getPageTitleFromPath } from '~/utils/title-utils'; export const AppRouterProviders = () => { const { pathname } = useLocation(); const pageTitle = getPageTitleFromPath(pathname); - const [isClientConfigLoaded] = useRecoilState(isClientConfigLoadedState); return ( - @@ -40,6 +36,7 @@ export const AppRouterProviders = () => { + diff --git a/packages/twenty-front/src/modules/client-config/components/ClientConfigProviderEffect.tsx b/packages/twenty-front/src/modules/client-config/components/ClientConfigProviderEffect.tsx index 640bb9e43f30..e69dfeb4f79d 100644 --- a/packages/twenty-front/src/modules/client-config/components/ClientConfigProviderEffect.tsx +++ b/packages/twenty-front/src/modules/client-config/components/ClientConfigProviderEffect.tsx @@ -48,6 +48,7 @@ export const ClientConfigProviderEffect = () => { useEffect(() => { if (!loading) { if (error !== undefined) { + setIsClientConfigLoaded(false); enqueueSnackBar('Unable to reach backend', { variant: SnackBarVariant.Error, }); @@ -100,9 +101,9 @@ export const ClientConfigProviderEffect = () => { setChromeExtensionId, setApiConfig, setIsAnalyticsEnabled, + error, + enqueueSnackBar, ]); - console.log('error: ', error, loading); - return <>; }; diff --git a/packages/twenty-ui/src/display/index.ts b/packages/twenty-ui/src/display/index.ts index 45144332b2bf..e8f248ba7a31 100644 --- a/packages/twenty-ui/src/display/index.ts +++ b/packages/twenty-ui/src/display/index.ts @@ -49,8 +49,8 @@ export * from './icon/types/IconComponent'; export * from './info/components/Info'; export * from './status/components/Status'; export * from './tag/components/Tag'; -export * from './text/components/SeparatorLineText'; export * from './text/components/HorizontalSeparator'; +export * from './text/components/SeparatorLineText'; export * from './tooltip/AppTooltip'; export * from './tooltip/OverflowingTextWithTooltip'; export * from './typography/components/H1Title';