From 98672402511671a678fbf2e197e020fcb55c0cb5 Mon Sep 17 00:00:00 2001 From: Nitin Koche Date: Fri, 16 Aug 2024 12:06:33 +0530 Subject: [PATCH] corrected targetableobject being undefined --- .../src/effect-components/PageChangeEffect.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/effect-components/PageChangeEffect.tsx b/packages/twenty-front/src/effect-components/PageChangeEffect.tsx index 5dd9c9b2845e..1e88b5bce643 100644 --- a/packages/twenty-front/src/effect-components/PageChangeEffect.tsx +++ b/packages/twenty-front/src/effect-components/PageChangeEffect.tsx @@ -16,10 +16,10 @@ import { AppPath } from '@/types/AppPath'; import { PageHotkeyScope } from '@/types/PageHotkeyScope'; import { SettingsPath } from '@/types/SettingsPath'; import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope'; +import { useCleanRecoilState } from '~/hooks/useCleanRecoilState'; import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation'; import { usePageChangeEffectNavigateLocation } from '~/hooks/usePageChangeEffectNavigateLocation'; import { isDefined } from '~/utils/isDefined'; -import { useCleanRecoilState } from '~/hooks/useCleanRecoilState'; // TODO: break down into smaller functions and / or hooks // - moved usePageChangeEffectNavigateLocation into dedicated hook @@ -153,7 +153,10 @@ export const PageChangeEffect = () => { label: 'Create Task', type: CommandType.Create, Icon: IconCheckbox, - onCommandClick: () => openCreateActivity({ targetableObjects: [] }), + onCommandClick: () => + openCreateActivity({ + targetableObjects: [{ id: '', targetObjectNameSingular: '' }], + }), }, ]); }, [addToCommandMenu, setToInitialCommandMenu, openCreateActivity]);