2
0

🐛 Fix group duplicate new title bug

This commit is contained in:
Baptiste Arnaud
2023-10-28 21:32:57 +02:00
parent bed8b42a2e
commit 2d1ce73931

View File

@@ -65,7 +65,7 @@ const groupsActions = (setTypebot: SetTypebot): GroupsActions => ({
const id = createId() const id = createId()
const totalGroupsWithSameTitle = typebot.groups.filter( const totalGroupsWithSameTitle = typebot.groups.filter(
(group) => group.title === group.title (g) => g.title === group.title
).length ).length
const newGroup: Group = { const newGroup: Group = {
@@ -76,7 +76,7 @@ const groupsActions = (setTypebot: SetTypebot): GroupsActions => ({
totalGroupsWithSameTitle > 0 totalGroupsWithSameTitle > 0
? ` (${totalGroupsWithSameTitle})` ? ` (${totalGroupsWithSameTitle})`
: '' : ''
}}`, }`,
id, id,
blocks: group.blocks.map((block) => duplicateBlockDraft(id)(block)), blocks: group.blocks.map((block) => duplicateBlockDraft(id)(block)),
graphCoordinates: { graphCoordinates: {