mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix(editor): Stop connection to last selected node when pasting on new canvas (no-changelog) (#11042)
This commit is contained in:
@@ -307,7 +307,7 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
||||
}
|
||||
|
||||
if (uiStore.lastInteractedWithNodeId === id) {
|
||||
uiStore.lastInteractedWithNodeId = null;
|
||||
uiStore.lastInteractedWithNodeId = undefined;
|
||||
}
|
||||
|
||||
connectAdjacentNodes(id, { trackHistory });
|
||||
@@ -387,7 +387,7 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
||||
|
||||
function setNodeSelected(id?: string) {
|
||||
if (!id) {
|
||||
uiStore.lastInteractedWithNodeId = null;
|
||||
uiStore.lastInteractedWithNodeId = undefined;
|
||||
uiStore.lastSelectedNode = '';
|
||||
return;
|
||||
}
|
||||
@@ -917,7 +917,7 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
||||
|
||||
position = [newNodeInsertPosition[0] + xOffset, newNodeInsertPosition[1] + yOffset];
|
||||
|
||||
uiStore.lastCancelledConnectionPosition = null;
|
||||
uiStore.lastCancelledConnectionPosition = undefined;
|
||||
} else if (lastInteractedWithNodeTypeDescription) {
|
||||
// When
|
||||
// - clicking the plus button of a node handle
|
||||
@@ -1617,6 +1617,8 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
||||
source: string,
|
||||
importTags = true,
|
||||
): Promise<IWorkflowDataUpdate> {
|
||||
uiStore.resetLastInteractedWith();
|
||||
|
||||
// If it is JSON check if it looks on the first look like data we can use
|
||||
if (!workflowData.hasOwnProperty('nodes') || !workflowData.hasOwnProperty('connections')) {
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user