mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix(editor): Update workflow re-initialization to use query parameter (#12650)
This commit is contained in:
parent
7cc553e3b2
commit
982131a75a
|
@ -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' },
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue