Skip to content

Commit

Permalink
code enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
khuddite committed Nov 13, 2024
1 parent 2a91456 commit 462a03f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 (
<ApolloProvider>
<ClientConfigProviderEffect />
<ChromeExtensionSidecarEffect />
<ChromeExtensionSidecarProvider>
<UserProviderEffect />
Expand All @@ -40,6 +36,7 @@ export const AppRouterProviders = () => {
<PrefetchDataProvider>
<AppThemeProvider>
<SnackBarProvider>
<ClientConfigProviderEffect />
<DialogManagerScope dialogManagerScopeId="dialog-manager">
<DialogManager>
<StrictMode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const ClientConfigProviderEffect = () => {
useEffect(() => {
if (!loading) {
if (error !== undefined) {
setIsClientConfigLoaded(false);
enqueueSnackBar('Unable to reach backend', {
variant: SnackBarVariant.Error,
});
Expand Down Expand Up @@ -100,9 +101,9 @@ export const ClientConfigProviderEffect = () => {
setChromeExtensionId,
setApiConfig,
setIsAnalyticsEnabled,
error,
enqueueSnackBar,
]);

console.log('error: ', error, loading);

return <></>;
};
2 changes: 1 addition & 1 deletion packages/twenty-ui/src/display/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 462a03f

Please sign in to comment.