mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
fix(editor): Delete all connections of nodes with multiple ones when removed from canvas (#15713)
This commit is contained in:
@@ -109,6 +109,7 @@ import type { CanvasLayoutEvent } from './useCanvasLayout';
|
||||
import { chatEventBus } from '@n8n/chat/event-buses';
|
||||
import { isChatNode } from '@/components/CanvasChat/utils';
|
||||
import { useLogsStore } from '@/stores/logs.store';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
type AddNodeData = Partial<INodeUi> & {
|
||||
type: string;
|
||||
@@ -1122,7 +1123,7 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
||||
);
|
||||
for (const nodeName of checkNodes) {
|
||||
const node = workflowsStore.nodesByName[nodeName];
|
||||
if (node.position[0] < sourceNode.position[0]) {
|
||||
if (!node || !sourceNode || node.position[0] < sourceNode.position[0]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1210,7 +1211,7 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
||||
historyStore.startRecordingUndo();
|
||||
}
|
||||
|
||||
const connections = workflowsStore.workflow.connections;
|
||||
const connections = cloneDeep(workflowsStore.workflow.connections);
|
||||
for (const nodeName of Object.keys(connections)) {
|
||||
const node = workflowsStore.getNodeByName(nodeName);
|
||||
if (!node) {
|
||||
|
||||
Reference in New Issue
Block a user