mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
🐛 Fix NodeViewNew navigation handling (#1853)
* 🐛 Fix NodeViewNew navigation handling * Use event emitter pattern to fix duplicate navigation * Apply review suggestions * Remove unnecessary arrow function * ⚡ Also fix for keyboard shortcut Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -495,10 +495,14 @@ export default mixins(
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
this.$router.push({ name: 'NodeViewNew' });
|
||||
if (this.$router.currentRoute.name === 'NodeViewNew') {
|
||||
this.$root.$emit('newWorkflow');
|
||||
} else {
|
||||
this.$router.push({ name: 'NodeViewNew' });
|
||||
}
|
||||
|
||||
this.$showMessage({
|
||||
title: 'Created',
|
||||
title: 'Workflow created',
|
||||
message: 'A new workflow got created!',
|
||||
type: 'success',
|
||||
});
|
||||
@@ -2063,6 +2067,8 @@ export default mixins(
|
||||
const resData = await this.importWorkflowData(data.data as IWorkflowDataUpdate);
|
||||
});
|
||||
|
||||
this.$root.$on('newWorkflow', this.newWorkflow);
|
||||
|
||||
this.$root.$on('importWorkflowUrl', async (data: IDataObject) => {
|
||||
const workflowData = await this.getWorkflowDataFromUrl(data.url as string);
|
||||
if (workflowData !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user