mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
Co-authored-by: Omar Ajoue <krynble@gmail.com>
This commit is contained in:
@@ -92,12 +92,28 @@ export default mixins(
|
||||
},
|
||||
async openWorkflow (data: IWorkflowShortResponse, column: any) { // tslint:disable-line:no-any
|
||||
if (column.label !== 'Active') {
|
||||
|
||||
const currentWorkflowId = this.$store.getters.workflowId;
|
||||
|
||||
if (data.id === currentWorkflowId) {
|
||||
this.$showMessage({
|
||||
title: 'Already open',
|
||||
message: 'This is the current workflow',
|
||||
type: 'error',
|
||||
duration: 800,
|
||||
});
|
||||
// Do nothing if current workflow is the one user chose to open
|
||||
return;
|
||||
}
|
||||
|
||||
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) {
|
||||
return;
|
||||
} else {
|
||||
// This is used to avoid duplicating the message
|
||||
this.$store.commit('setStateDirty', false);
|
||||
this.$emit('openWorkflow', data.id);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user