Skip to content

Commit

Permalink
fix(ui): broken edit of scene values (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Mar 16, 2021
1 parent 18d6023 commit ed2d639
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/Scenes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,24 @@ export default {
},
editItem (item) {
this.editedIndex = this.scene_values.indexOf(item)
const node = this.nodes[item.nodeId]
const node = this.nodes.find(n => n.id === item.nodeId) || {
id: item.nodeId,
name: '',
loc: '',
values: []
}
let value = node.values.find(v => v.id === item.id)
value = Object.assign({}, value)
value = value ? Object.assign({}, value) : Object.assign({}, item)
value.newValue = item.value
this.editedValue = {
node: node,
value: value,
timeout: this.scene_values[this.editedIndex].timeout
timeout: item.timeout
}
this.dialogValue = true
},
async deleteItem (value) {
Expand Down

0 comments on commit ed2d639

Please sign in to comment.