From 090c5394e3311fca064eabe94479ec50ce16d3dc Mon Sep 17 00:00:00 2001 From: bosiraphael Date: Tue, 17 Dec 2024 16:51:22 +0100 Subject: [PATCH] change default value to null --- .../modules/command-menu/hooks/useCommandMenu.ts | 2 +- .../ContextStoreCurrentViewTypeEffect.tsx | 2 +- .../contextStoreCurrentViewTypeComponentState.ts | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts index d9924cb1a7e0..46eea6f6cb6d 100644 --- a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts +++ b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts @@ -185,7 +185,7 @@ export const useCommandMenu = () => { contextStoreCurrentViewTypeComponentState.atomFamily({ instanceId: 'command-menu', }), - undefined, + null, ); if (isCommandMenuOpened) { diff --git a/packages/twenty-front/src/modules/context-store/components/ContextStoreCurrentViewTypeEffect.tsx b/packages/twenty-front/src/modules/context-store/components/ContextStoreCurrentViewTypeEffect.tsx index 6e073d7ded11..2f2913ddee3d 100644 --- a/packages/twenty-front/src/modules/context-store/components/ContextStoreCurrentViewTypeEffect.tsx +++ b/packages/twenty-front/src/modules/context-store/components/ContextStoreCurrentViewTypeEffect.tsx @@ -6,7 +6,7 @@ import { useEffect } from 'react'; export const ContextStoreCurrentViewTypeEffect = ({ viewType, }: { - viewType: ContextStoreViewType | undefined; + viewType: ContextStoreViewType | null; }) => { const setContextStoreCurrentViewType = useSetRecoilComponentStateV2( contextStoreCurrentViewTypeComponentState, diff --git a/packages/twenty-front/src/modules/context-store/states/contextStoreCurrentViewTypeComponentState.ts b/packages/twenty-front/src/modules/context-store/states/contextStoreCurrentViewTypeComponentState.ts index 17ef17180eac..d9a5bca60c19 100644 --- a/packages/twenty-front/src/modules/context-store/states/contextStoreCurrentViewTypeComponentState.ts +++ b/packages/twenty-front/src/modules/context-store/states/contextStoreCurrentViewTypeComponentState.ts @@ -2,10 +2,9 @@ import { ContextStoreComponentInstanceContext } from '@/context-store/states/con import { ContextStoreViewType } from '@/context-store/types/ContextStoreViewType'; import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2'; -export const contextStoreCurrentViewTypeComponentState = createComponentStateV2< - ContextStoreViewType | undefined ->({ - key: 'contextStoreCurrentViewTypeComponentState', - defaultValue: undefined, - componentInstanceContext: ContextStoreComponentInstanceContext, -}); +export const contextStoreCurrentViewTypeComponentState = + createComponentStateV2({ + key: 'contextStoreCurrentViewTypeComponentState', + defaultValue: null, + componentInstanceContext: ContextStoreComponentInstanceContext, + });