From d1f9cef891e4f30dab1724bf055a426fb6884e25 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Wed, 2 Sep 2020 15:59:20 +0200 Subject: [PATCH] :zap: Fixed dirty state not being triggered with node connection --- packages/editor-ui/src/store.ts | 3 ++- packages/editor-ui/src/views/NodeView.vue | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/editor-ui/src/store.ts b/packages/editor-ui/src/store.ts index 4c4736541a..4960aa8acf 100644 --- a/packages/editor-ui/src/store.ts +++ b/packages/editor-ui/src/store.ts @@ -160,6 +160,7 @@ export const store = new Vuex.Store({ // Selected Nodes addSelectedNode (state, node: INodeUi) { + state.stateIsDirty = true; state.selectedNodes.push(node); }, removeNodeFromSelection (state, node: INodeUi) { @@ -189,7 +190,7 @@ export const store = new Vuex.Store({ return; } - if (data.setStateDirty) { + if (data.setStateDirty === true) { state.stateIsDirty = true; } diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 2ab3b3952e..4aa2b02856 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -1239,7 +1239,6 @@ export default mixins( if (![null, undefined].includes(inputNameOverlay)) { inputNameOverlay.setVisible(false); } - this.$store.commit('addConnection', { connection: [ { @@ -1253,6 +1252,7 @@ export default mixins( index: targetInfo.index, }, ], + setStateDirty: true, }); }); @@ -1388,11 +1388,10 @@ export default mixins( detachable: !this.isReadOnly, }); } else { - // @ts-ignore - connection.setStateDirty = false; + let connectionProperties = {connection, setStateDirty: false}; // When nodes get connected it gets saved automatically to the storage // so if we do not connect we have to save the connection manually - this.$store.commit('addConnection', { connection }); + this.$store.commit('addConnection', connectionProperties); } }, __removeConnection (connection: [IConnection, IConnection], removeVisualConnection = false) {