fix(ui): remove node field from form correctly when node is deleted

This commit is contained in:
psychedelicious
2025-02-06 19:54:40 +11:00
parent e948e236e7
commit efec224523

View File

@@ -302,7 +302,7 @@ export const workflowSlice = createSlice({
const removeIndex = action.payload.findLastIndex((change) => change.type === 'remove' && change.id === nodeId);
const addIndex = action.payload.findLastIndex((change) => change.type === 'add' && change.item.id === nodeId);
if (removeIndex > addIndex) {
delete state.form?.elements[el.id];
removeElement({ formState: state.form, id: el.id });
}
}