🚧 Added Vuex dirty state flag as central source of truth for if there are unsaved changes

This commit is contained in:
Rupenieks
2020-09-01 16:06:08 +02:00
parent 66b76d16ee
commit 3e1ada7c1a
8 changed files with 92 additions and 49 deletions

View File

@@ -420,7 +420,7 @@ export const workflowHelpers = mixins(
this.$store.commit('setActive', workflowData.active || false);
this.$store.commit('setWorkflowId', workflowData.id);
this.$store.commit('setWorkflowName', workflowData.name);
this.$store.commit('setWorkflowName', {newName: workflowData.name, setStateDirty: false});
this.$store.commit('setWorkflowSettings', workflowData.settings || {});
} else {
// Workflow exists already so update it
@@ -435,7 +435,7 @@ export const workflowHelpers = mixins(
}
this.$store.commit('removeActiveAction', 'workflowSaving');
this.$store.commit('setStateDirty', false);
this.$showMessage({
title: 'Workflow saved',
message: `The workflow "${workflowData.name}" got saved!`,
@@ -492,13 +492,13 @@ export const workflowHelpers = mixins(
nodes: data.nodes,
connections: data.connections,
settings: data.settings,
name: data.name
name: data.name,
};
const y = {
nodes: currentData.nodes,
connections: currentData.connections,
settings: currentData.settings,
name: currentData.name
name: currentData.name,
};
return !isEqual(x, y);
}