Fixed cut & paste causing duplicate container children mapping (#2508)

This commit is contained in:
Shaurya Sharma 2024-10-25 12:39:42 +05:30 committed by Shaurya Sharma
parent ed75923193
commit c55157afcd

View file

@ -741,7 +741,9 @@ export const createComponentsSlice = (set, get) => ({
if (!state.containerChildrenMapping[parentId]) {
state.containerChildrenMapping[parentId] = [];
}
state.containerChildrenMapping[parentId].push(newComponent.id);
if (!state.containerChildrenMapping[parentId].includes(newComponent.id)) {
state.containerChildrenMapping[parentId].push(newComponent.id);
}
const page = state.modules[moduleId].pages[state.currentPageIndex];
page.components[newComponent.id] = newComponent;
}, skipUndoRedo),