diff --git a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerCreateOrEditContent.tsx b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerCreateOrEditContent.tsx index 8a1dc16e26..a5402ea20f 100644 --- a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerCreateOrEditContent.tsx +++ b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerCreateOrEditContent.tsx @@ -79,6 +79,8 @@ export const ViewPickerCreateOrEditContent = () => { const { handleCreate, handleUpdate } = useViewPickerPersistView(); + const { availableFieldsForKanban } = useGetAvailableFieldsForKanban(); + useScopedHotkeys( Key.Enter, async () => { @@ -86,6 +88,12 @@ export const ViewPickerCreateOrEditContent = () => { return; } if (viewPickerMode === 'create') { + if ( + viewPickerType === ViewType.Kanban && + availableFieldsForKanban.length === 0 + ) { + return; + } await handleCreate(); } if (viewPickerMode === 'edit') { @@ -100,8 +108,6 @@ export const ViewPickerCreateOrEditContent = () => { setViewPickerSelectedIcon(iconKey); }; - const { availableFieldsForKanban } = useGetAvailableFieldsForKanban(); - const handleClose = async () => { if (viewPickerMode === 'edit') { await handleUpdate();