Skip to content

Commit

Permalink
look for changes in both id and stored id for better reload control
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Jan 19, 2024
1 parent 064654d commit 8506769
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions client/src/entry/analysis/modules/WorkflowEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,27 @@ export default {
},
methods: {
async getEditorConfig() {
const storedWorkflowId = Query.get("id");
const workflowId = Query.get("workflow_id");
let reloadEditor = true;
// this will only be the case the first time the route updates from a new workflow
if (!this.storedWorkflowId && !this.workflowId) {
reloadEditor = false;
}
this.storedWorkflowId = Query.get("id");
this.workflowId = Query.get("workflow_id");
const params = {};
if (workflowId) {
params.workflow_id = workflowId;
} else if (storedWorkflowId) {
params.id = storedWorkflowId;
if (this.workflowId) {
params.workflow_id = this.workflowId;
} else if (this.storedWorkflowId) {
params.id = this.storedWorkflowId;
}
const previousId = this.editorConfig?.id;
this.editorConfig = await urlData({ url: "/workflow/editor", params });
if (previousId !== undefined && previousId !== this.editorConfig?.id) {
if (reloadEditor) {
this.editorReloadKey += 1;
}
},
Expand Down

0 comments on commit 8506769

Please sign in to comment.