🚧 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

@@ -92,8 +92,7 @@ export default mixins(
},
async openWorkflow (data: IWorkflowShortResponse, column: any) { // tslint:disable-line:no-any
if (column.label !== 'Active') {
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 === false) {