mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
🚧 Added Vuex dirty state flag as central source of truth for if there are unsaved changes
This commit is contained in:
@@ -398,7 +398,7 @@ export default mixins(
|
||||
return;
|
||||
}
|
||||
|
||||
this.$store.commit('setWorkflowName', workflowName);
|
||||
this.$store.commit('setWorkflowName', {newName: workflowName, setStateDirty: true});
|
||||
|
||||
this.$showMessage({
|
||||
title: 'Workflow renamed',
|
||||
@@ -440,18 +440,15 @@ export default mixins(
|
||||
|
||||
saveAs(blob, workflowName + '.json');
|
||||
} else if (key === 'workflow-save') {
|
||||
console.log("saving......");
|
||||
this.saveCurrentWorkflow();
|
||||
} else if (key === 'workflow-save-as') {
|
||||
console.log("saving......");
|
||||
this.saveCurrentWorkflow(true);
|
||||
} else if (key === 'help-about') {
|
||||
this.aboutDialogVisible = true;
|
||||
} else if (key === 'workflow-settings') {
|
||||
this.workflowSettingsDialogVisible = true;
|
||||
} else if (key === 'workflow-new') {
|
||||
const workflowId = this.$store.getters.workflowId;
|
||||
const result = await this.dataHasChanged(workflowId);
|
||||
const result = this.$store.getters.getStateIsDirty;
|
||||
if(result) {
|
||||
const importConfirm = await this.confirmMessage(`When you switch workflows your current workflow changes will be lost.`, 'Save your Changes?', 'warning', 'Yes, switch workflows and forget changes');
|
||||
if (importConfirm === true) {
|
||||
|
||||
Reference in New Issue
Block a user