diff --git a/apps/builder/src/features/editor/providers/typebotActions/blocks.ts b/apps/builder/src/features/editor/providers/typebotActions/blocks.ts index 14f5469a5..a2ed722d6 100644 --- a/apps/builder/src/features/editor/providers/typebotActions/blocks.ts +++ b/apps/builder/src/features/editor/providers/typebotActions/blocks.ts @@ -95,6 +95,7 @@ export const blocksAction = ( const removeBlockFromGroup = ({ groupIndex, blockIndex }: BlockIndices) => (typebot: WritableDraft) => { + if (typebot.groups[groupIndex].blocks[blockIndex].type === 'start') return typebot.groups[groupIndex].blocks.splice(blockIndex, 1) } @@ -205,6 +206,7 @@ export const duplicateBlockDraft = export const deleteGroupDraft = (typebot: WritableDraft) => (groupIndex: number) => { + if (typebot.groups[groupIndex].blocks.at(0)?.type === 'start') return cleanUpEdgeDraft(typebot, typebot.groups[groupIndex].id) typebot.groups.splice(groupIndex, 1) }