fix: storage not properly preloading

* Add elements to store state when using addElements action

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-19 13:42:41 +01:00
parent 48da1eccba
commit b91d65fd3a
2 changed files with 10 additions and 9 deletions
+1
View File
@@ -236,6 +236,7 @@ export default function flowStore(
},
addElements(elements: Elements) {
const { nextNodes, nextEdges } = parseElements(elements, this.nodes, this.edges, this.nodeExtent)
this.elements = [...this.elements, ...elements]
this.nodes = [...this.nodes, ...nextNodes]
this.edges = [...this.edges, ...nextEdges]
},