Skip to content

Commit

Permalink
reload if window is navigated to/from new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Dec 6, 2024
1 parent ecb8820 commit c554011
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/src/entry/analysis/modules/WorkflowEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
version: null,
editorConfig: null,
editorReloadKey: 0,
previousHistoryLength: 0,
};
},
watch: {
Expand All @@ -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 = {};
Expand Down

0 comments on commit c554011

Please sign in to comment.