From 0eb2fbb6f118546fe7e6feab4b1c84d4952de68a Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:08:26 +0100 Subject: [PATCH] reload if window is navigated to/from new workflow --- client/src/entry/analysis/modules/WorkflowEditor.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/entry/analysis/modules/WorkflowEditor.vue b/client/src/entry/analysis/modules/WorkflowEditor.vue index 67634f4a3842..c3010426c026 100644 --- a/client/src/entry/analysis/modules/WorkflowEditor.vue +++ b/client/src/entry/analysis/modules/WorkflowEditor.vue @@ -25,6 +25,7 @@ export default { version: null, editorConfig: null, editorReloadKey: 0, + previousHistoryLength: 0, }; }, watch: { @@ -39,14 +40,18 @@ export default { async getEditorConfig() { let reloadEditor = true; + const noStoredIds = !this.storedWorkflowId && !this.workflowId; + const historyNavigatedForwards = window.history.length > this.previousHistoryLength; + // this will only be the case the first time the route updates from a new workflow - if (!this.storedWorkflowId && !this.workflowId) { + if (noStoredIds && historyNavigatedForwards) { reloadEditor = false; } this.storedWorkflowId = Query.get("id"); this.workflowId = Query.get("workflow_id"); this.version = Query.get("version"); + this.previousHistoryLength = window.history.length; const params = {};