2
0

🐛 (editor) Remove edge if duplicating last block of group

This commit is contained in:
Baptiste Arnaud
2023-05-25 08:27:36 +02:00
parent fdfed160a6
commit 6bb6a2b0e3

View File

@@ -71,6 +71,9 @@ export const blocksAction = (
setTypebot((typebot) =>
produce(typebot, (typebot) => {
const block = { ...typebot.groups[groupIndex].blocks[blockIndex] }
const blocks = typebot.groups[groupIndex].blocks
if (blockIndex === blocks.length - 1 && block.outgoingEdgeId)
deleteEdgeDraft(typebot, block.outgoingEdgeId as string)
const newBlock = duplicateBlockDraft(block.groupId)(
block,
onWebhookBlockDuplicated