feat(editor): Open NDV when a node is added to canvas v2 (no-changelog) (#10114)

This commit is contained in:
Elias Meire
2024-07-19 14:29:11 +02:00
committed by GitHub
parent 4559e3ae18
commit 062633ec9b
2 changed files with 21 additions and 1 deletions

View File

@@ -76,7 +76,7 @@ import type {
import { NodeConnectionType, NodeHelpers, TelemetryHelpers } from 'n8n-workflow';
import { v4 as uuid } from 'uuid';
import type { Ref } from 'vue';
import { computed } from 'vue';
import { computed, nextTick } from 'vue';
import type { useRouter } from 'vue-router';
type AddNodeData = Partial<INodeUi> & {
@@ -429,6 +429,12 @@ export function useCanvasOperations({
workflowsStore.setNodePristine(nodeData.name, true);
uiStore.stateIsDirty = true;
if (options.openNDV) {
void nextTick(() => {
ndvStore.setActiveNodeName(nodeData.name);
});
}
return nodeData;
}