Fixed dirty state not being triggered with node connection

This commit is contained in:
Rupenieks 2020-09-02 15:59:20 +02:00
parent 4c04cc015d
commit d1f9cef891
2 changed files with 5 additions and 5 deletions

View file

@ -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;
}

View file

@ -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) {