From af7f6db68c3b3a56835bb1dd5d8b3fefd80aedde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 17 Jun 2024 11:59:29 +0200 Subject: [PATCH 1/2] fix(editor): Active toggle incorrectly displayed as inactive in execution view --- .../src/components/MainHeader/MainHeader.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/editor-ui/src/components/MainHeader/MainHeader.vue b/packages/editor-ui/src/components/MainHeader/MainHeader.vue index 8f484042cb92d..1074571b307f6 100644 --- a/packages/editor-ui/src/components/MainHeader/MainHeader.vue +++ b/packages/editor-ui/src/components/MainHeader/MainHeader.vue @@ -98,9 +98,19 @@ export default defineComponent({ beforeMount() { this.pushConnection.initialize(); }, - mounted() { + async mounted() { this.dirtyState = this.uiStore.stateIsDirty; this.syncTabsWithRoute(this.$route); + + const workflowId = this.$route.params.name as string; + const workflow = await this.workflowsStore.fetchWorkflow(workflowId); + + this.workflowsStore.setWorkflowId(workflowId); + + if (workflow.active) { + this.workflowsStore.setWorkflowActive(workflowId); + this.workflowsStore.setActive(workflow.active); + } }, beforeUnmount() { this.pushConnection.terminate(); From 87ebe4ce8c6f2d96df1724e3310c35709c73b29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 17 Jun 2024 15:48:00 +0200 Subject: [PATCH 2/2] Add placeholder check --- .../src/components/MainHeader/MainHeader.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/editor-ui/src/components/MainHeader/MainHeader.vue b/packages/editor-ui/src/components/MainHeader/MainHeader.vue index 1074571b307f6..c70b3a573d9e1 100644 --- a/packages/editor-ui/src/components/MainHeader/MainHeader.vue +++ b/packages/editor-ui/src/components/MainHeader/MainHeader.vue @@ -102,14 +102,16 @@ export default defineComponent({ this.dirtyState = this.uiStore.stateIsDirty; this.syncTabsWithRoute(this.$route); - const workflowId = this.$route.params.name as string; - const workflow = await this.workflowsStore.fetchWorkflow(workflowId); + if (this.workflowsStore.workflow.id === PLACEHOLDER_EMPTY_WORKFLOW_ID) { + const workflowId = this.$route.params.name as string; + const workflow = await this.workflowsStore.fetchWorkflow(workflowId); - this.workflowsStore.setWorkflowId(workflowId); + this.workflowsStore.setWorkflowId(workflowId); - if (workflow.active) { - this.workflowsStore.setWorkflowActive(workflowId); - this.workflowsStore.setActive(workflow.active); + if (workflow.active) { + this.workflowsStore.setWorkflowActive(workflowId); + this.workflowsStore.setActive(workflow.active); + } } }, beforeUnmount() {