Skip to content

Commit

Permalink
fix workflow creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Dec 12, 2024
1 parent 6ba629a commit 424aeda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions client/src/components/Workflow/Editor/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,7 @@ export default {
const { id, name, number_of_steps } = await this.services.createWorkflow(this);
const message = `Created new workflow '${name}' with ${number_of_steps} steps.`;
this.hasChanges = false;
this.$emit("skipNextReload");
await this.routeToWorkflow(id);
Toast.success(message);
} catch (e) {
Expand Down
12 changes: 5 additions & 7 deletions client/src/entry/analysis/modules/WorkflowEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
:initial-version="editorConfig.initialVersion"
:module-sections="editorConfig.moduleSections"
:workflow-tags="editorConfig.tags"
@update:confirmation="$emit('update:confirmation', $event)" />
@update:confirmation="$emit('update:confirmation', $event)"
@skipNextReload="() => (skipNextReload = true)" />
</template>
<script>
import Editor from "components/Workflow/Editor/Index";
Expand All @@ -25,7 +26,7 @@ export default {
version: null,
editorConfig: null,
editorReloadKey: 0,
previousHistoryLength: 0,
skipNextReload: false,
};
},
watch: {
Expand All @@ -40,12 +41,9 @@ 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 (noStoredIds && historyNavigatedForwards) {
if (this.skipNextReload) {
reloadEditor = false;
this.skipNextReload = false;
}
this.storedWorkflowId = Query.get("id");
Expand Down

0 comments on commit 424aeda

Please sign in to comment.