Skip to content

Commit 41801be

Browse files
committed
drag and drop fixes
Signed-off-by: Mark Herwege <[email protected]>
1 parent a2c16e1 commit 41801be

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

bundles/org.openhab.ui/web/src/pages/settings/model/model-dragdrop-mixin.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ export default {
468468
const nodeChildren = this.nodeChildren(node)
469469
nodeChildren.filter((n) => !n.class).forEach((n) => this.addIntoLocation(n, node))
470470
this.updateAfterAdd(node, parentNode, semantics)
471-
this.saveUpdate()
472471
console.timeEnd('Timer: addLocation')
473472
},
474473
addEquipment (node, parentNode) {
@@ -486,7 +485,6 @@ export default {
486485
const nodeChildren = this.nodeChildren(node)
487486
nodeChildren.filter((n) => !n.class).forEach((n) => this.addIntoEquipment(n, node))
488487
this.updateAfterAdd(node, parentNode, semantics)
489-
this.saveUpdate()
490488
console.timeEnd('Timer: addEquipment')
491489
},
492490
addPoint (node, parentNode) {
@@ -502,7 +500,6 @@ export default {
502500
if (!node.item.tags.includes(tag)) node.item.tags.push(tag)
503501
node.class = semantics.value
504502
this.updateAfterAdd(node, parentNode, semantics)
505-
this.saveUpdate()
506503
console.timeEnd('Timer: addPoint')
507504
},
508505
addNonSemantic (node, parentNode) {
@@ -626,11 +623,13 @@ export default {
626623
saveModelUpdate () {
627624
console.time('Timer: saveModelUpdate')
628625
this.moveState.dragFinished = false
626+
const promises = []
629627
this.moveState.nodesToUpdate.forEach((n) => {
630628
const updatedItem = n.item
631629
console.debug('Save - updatedItem: ', cloneDeep(updatedItem))
632-
this.saveItem(updatedItem)
630+
promises.push(this.saveItem(updatedItem))
633631
})
632+
Promise.all(promises)
634633
this.moveState.saving = false
635634
console.timeEnd('Timer: saveModelUpdate')
636635
console.timeEnd('Timer: Drag')

0 commit comments

Comments
 (0)