update(store): use setElements for addElements with force set false

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-26 11:26:37 +01:00
parent 4630f3efc1
commit 512df8e42b
2 changed files with 7 additions and 4 deletions
+1 -2
View File
@@ -179,8 +179,7 @@ export default (id: string, preloadedState: FlowState) => {
this.elementsSelectable = isInteractive
},
addElements(elements: Elements) {
const { nodes, edges } = parseElements(elements, this.elements, this.nodeExtent)
this.elements = [...this.elements, ...nodes, ...edges]
this.setElements(elements, false)
},
setState(state) {
if (typeof state.loading !== 'undefined') this.loading = state.loading