From e6a5a63acf86c7694e379eedfaabc2830e85aaab Mon Sep 17 00:00:00 2001 From: martmull Date: Thu, 11 Apr 2024 18:26:55 +0200 Subject: [PATCH] Provide initialSnapshot to logout recoil state update snapshot (#4929) --- packages/twenty-front/src/modules/auth/hooks/useAuth.ts | 5 +++++ .../meta-types/input/components/DateFieldInput.tsx | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/auth/hooks/useAuth.ts b/packages/twenty-front/src/modules/auth/hooks/useAuth.ts index 53bed216222b..dce9f59424dd 100644 --- a/packages/twenty-front/src/modules/auth/hooks/useAuth.ts +++ b/packages/twenty-front/src/modules/auth/hooks/useAuth.ts @@ -10,6 +10,7 @@ import { import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState'; import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState'; +import { isCurrentUserLoadedState } from '@/auth/states/isCurrentUserLoadingState.ts'; import { isVerifyPendingState } from '@/auth/states/isVerifyPendingState'; import { workspacesState } from '@/auth/states/workspaces'; import { authProvidersState } from '@/client-config/states/authProvidersState'; @@ -169,9 +170,13 @@ export const useAuth = () => { const isClientConfigLoaded = snapshot .getLoadable(isClientConfigLoadedState) .getValue(); + const isCurrentUserLoaded = snapshot + .getLoadable(isCurrentUserLoadedState) + .getValue(); const initialSnapshot = emptySnapshot.map(({ set }) => { set(isClientConfigLoadedState, isClientConfigLoaded); + set(isCurrentUserLoadedState, isCurrentUserLoaded); set(iconsState, iconsValue); set(authProvidersState, authProvidersValue); set(billingState, billing); diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateFieldInput.tsx index 1c9b4a8692ba..631d25624c13 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateFieldInput.tsx +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateFieldInput.tsx @@ -32,7 +32,6 @@ export const DateFieldInput = ({ }; const handleEnter = (newDate: Nullable) => { - console.log('newDate enter', newDate); onEnter?.(() => persistDate(newDate)); };