mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix: store copy of workflow in workflowsById to prevent node data bugs (#4637)
This commit is contained in:
parent
dea67ca6b7
commit
9cadaea3a4
|
@ -24,6 +24,7 @@ import {
|
||||||
} from "@/Interface";
|
} from "@/Interface";
|
||||||
import {defineStore} from "pinia";
|
import {defineStore} from "pinia";
|
||||||
import {
|
import {
|
||||||
|
deepCopy,
|
||||||
IConnection,
|
IConnection,
|
||||||
IConnections,
|
IConnections,
|
||||||
IDataObject,
|
IDataObject,
|
||||||
|
@ -334,7 +335,10 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||||
},
|
},
|
||||||
|
|
||||||
addWorkflow(workflow: IWorkflowDb) : void {
|
addWorkflow(workflow: IWorkflowDb) : void {
|
||||||
Vue.set(this.workflowsById, workflow.id, workflow);
|
Vue.set(this.workflowsById, workflow.id, {
|
||||||
|
...this.workflowsById[workflow.id],
|
||||||
|
...deepCopy(workflow),
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setWorkflowActive(workflowId: string): void {
|
setWorkflowActive(workflowId: string): void {
|
||||||
|
|
|
@ -834,6 +834,7 @@ export default mixins(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.workflowsStore.addWorkflow(data);
|
||||||
this.workflowsStore.setActive(data.active || false);
|
this.workflowsStore.setActive(data.active || false);
|
||||||
this.workflowsStore.setWorkflowId(workflowId);
|
this.workflowsStore.setWorkflowId(workflowId);
|
||||||
this.workflowsStore.setWorkflowName({ newName: data.name, setStateDirty: false });
|
this.workflowsStore.setWorkflowName({ newName: data.name, setStateDirty: false });
|
||||||
|
@ -841,20 +842,6 @@ export default mixins(
|
||||||
this.workflowsStore.setWorkflowPinData(data.pinData || {});
|
this.workflowsStore.setWorkflowPinData(data.pinData || {});
|
||||||
this.workflowsStore.setWorkflowHash(data.hash);
|
this.workflowsStore.setWorkflowHash(data.hash);
|
||||||
|
|
||||||
this.workflowsStore.addWorkflow({
|
|
||||||
id: data.id,
|
|
||||||
name: data.name,
|
|
||||||
ownedBy: data.ownedBy,
|
|
||||||
sharedWith: data.sharedWith,
|
|
||||||
tags: data.tags || [],
|
|
||||||
active: data.active,
|
|
||||||
createdAt: data.createdAt,
|
|
||||||
updatedAt: data.updatedAt,
|
|
||||||
nodes: data.nodes,
|
|
||||||
connections: data.connections,
|
|
||||||
hash: '',
|
|
||||||
});
|
|
||||||
|
|
||||||
if (data.ownedBy) {
|
if (data.ownedBy) {
|
||||||
this.workflowsEEStore.setWorkflowOwnedBy({
|
this.workflowsEEStore.setWorkflowOwnedBy({
|
||||||
workflowId: data.id,
|
workflowId: data.id,
|
||||||
|
|
Loading…
Reference in a new issue