mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-01 18:35:00 -05:00
feat(ui): remove extraneous formContainerChildrenReordered action
This commit is contained in:
@@ -28,8 +28,8 @@ import {
|
||||
import { getEditModeWrapperId } from 'features/nodes/components/sidePanel/builder/shared';
|
||||
import { selectNodesSlice } from 'features/nodes/store/selectors';
|
||||
import {
|
||||
formContainerChildrenReordered,
|
||||
formElementAdded,
|
||||
formElementContainerDataChanged,
|
||||
formElementReparented,
|
||||
selectFormRootElementId,
|
||||
selectWorkflowSlice,
|
||||
@@ -260,7 +260,7 @@ export const useBuilderDndMonitor = () => {
|
||||
const container = getElement(targetElement.parentId, isContainerElement);
|
||||
const startIndex = container.data.children.indexOf(sourceElement.id);
|
||||
const indexOfTarget = container.data.children.indexOf(targetElement.id);
|
||||
const reorderedLayout = reorderWithEdge({
|
||||
const reorderedChildren = reorderWithEdge({
|
||||
list: container.data.children,
|
||||
startIndex,
|
||||
indexOfTarget,
|
||||
@@ -268,9 +268,9 @@ export const useBuilderDndMonitor = () => {
|
||||
axis: container.data.layout === 'row' ? 'horizontal' : 'vertical',
|
||||
});
|
||||
dispatchAndFlash(
|
||||
formContainerChildrenReordered({
|
||||
formElementContainerDataChanged({
|
||||
id: container.id,
|
||||
children: reorderedLayout,
|
||||
changes: { children: reorderedChildren },
|
||||
}),
|
||||
sourceElement.id
|
||||
);
|
||||
|
||||
@@ -182,15 +182,6 @@ export const workflowSlice = createSlice({
|
||||
removeElement({ form, id });
|
||||
delete state.formFieldInitialValues[id];
|
||||
},
|
||||
formContainerChildrenReordered: (state, action: PayloadAction<{ id: string; children: string[] }>) => {
|
||||
const { form } = state;
|
||||
const { id, children } = action.payload;
|
||||
const container = form.elements[id];
|
||||
if (!container || !isContainerElement(container)) {
|
||||
return;
|
||||
}
|
||||
container.data.children = children;
|
||||
},
|
||||
formElementReparented: (state, action: PayloadAction<{ id: string; newParentId: string; index: number }>) => {
|
||||
const { form } = state;
|
||||
const { id, newParentId, index } = action.payload;
|
||||
@@ -338,7 +329,6 @@ export const {
|
||||
formElementAdded,
|
||||
formElementRemoved,
|
||||
formElementReparented,
|
||||
formContainerChildrenReordered,
|
||||
formElementHeadingDataChanged,
|
||||
formElementTextDataChanged,
|
||||
formElementNodeFieldDataChanged,
|
||||
|
||||
Reference in New Issue
Block a user