From c554011dc74cd86def883918188db48767490484 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 fb8ed6eea9d5..d5caaa57c607 100644 --- a/client/src/entry/analysis/modules/WorkflowEditor.vue +++ b/client/src/entry/analysis/modules/WorkflowEditor.vue @@ -26,6 +26,7 @@ export default { version: null, editorConfig: null, editorReloadKey: 0, + previousHistoryLength: 0, }; }, watch: { @@ -40,14 +41,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 = {};