2
0

🚑 (editor) Fix move block with outgoing edge

This commit is contained in:
Baptiste Arnaud
2023-11-08 18:31:32 +01:00
parent b73ca7a98a
commit 58b9e0b306

View File

@ -119,7 +119,7 @@ const moveBlockToGroup = (
const newBlock = { ...block } const newBlock = { ...block }
if (block.outgoingEdgeId) { if (block.outgoingEdgeId) {
if (typebot.groups[groupIndex].blocks.length > blockIndex ?? 0) { if (typebot.groups[groupIndex].blocks.length > blockIndex ?? 0) {
deleteEdgeDraft({ typebot, edgeId: block.outgoingEdgeId }) deleteEdgeDraft({ typebot, edgeId: block.outgoingEdgeId, groupIndex })
newBlock.outgoingEdgeId = undefined newBlock.outgoingEdgeId = undefined
} else { } else {
const edgeIndex = typebot.edges.findIndex(byId(block.outgoingEdgeId)) const edgeIndex = typebot.edges.findIndex(byId(block.outgoingEdgeId))