fix(editor): Update workflow re-initialization to use query parameter (#12650)

This commit is contained in:
oleg 2025-01-17 09:33:02 +01:00 committed by GitHub
parent 7cc553e3b2
commit 982131a75a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View file

@ -1000,9 +1000,10 @@ export function useWorkflowHelpers(options: { router: ReturnType<typeof useRoute
}
if (redirect) {
void router.replace({
await router.replace({
name: VIEWS.WORKFLOW,
params: { name: workflowData.id, action: 'workflowSave' },
params: { name: workflowData.id },
query: { action: 'workflowSave' },
});
}

View file

@ -308,8 +308,13 @@ async function initializeData() {
async function initializeRoute(force = false) {
// In case the workflow got saved we do not have to run init
// as only the route changed but all the needed data is already loaded
if (route.params.action === 'workflowSave') {
if (route.query.action === 'workflowSave') {
uiStore.stateIsDirty = false;
// Remove the action from the query
await router.replace({
query: { ...route.query, action: undefined },
});
return;
}

View file

@ -3392,10 +3392,15 @@ export default defineComponent({
async initView(): Promise<void> {
await this.loadCredentialsForWorkflow();
if (this.$route.params.action === 'workflowSave') {
if (this.$route.query.action === 'workflowSave') {
// In case the workflow got saved we do not have to run init
// as only the route changed but all the needed data is already loaded
this.uiStore.stateIsDirty = false;
// Remove the action from the query
await this.$router.replace({
query: { ...this.$route.query, action: undefined },
});
return;
}
if (this.blankRedirect) {