Skip to content

Commit

Permalink
Merge c7f69f3 into 4194cd2
Browse files Browse the repository at this point in the history
  • Loading branch information
hubsif authored Jun 5, 2021
2 parents 4194cd2 + c7f69f3 commit 757cdde
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ export default {
channelUID: null,
configuration: {}
},
selectedItem: null,
selectedItemName: null,
selectedThingId: '',
selectedThing: {},
Expand All @@ -183,10 +182,10 @@ export default {
},
computed: {
currentItem () {
return this.item ? this.item : this.createItem ? this.newItem : this.selectedItemName
return this.item ? this.item : this.createItem ? this.newItem : this.items.find(item => item.name === this.selectedItemName)
},
compatibleProfileTypes () {
let currentItemType = this.currentItem ? this.currentItem.type : null
let currentItemType = this.currentItem && this.currentItem.type ? this.currentItem.type : ''
return this.profileTypes.filter(p => !p.supportedItemTypes.length || p.supportedItemTypes.includes(currentItemType.split(':', 1)[0]))
}
},
Expand Down Expand Up @@ -251,13 +250,7 @@ export default {
link.channelUID = this.selectedChannel.uid
}
if (this.item) {
link.itemName = this.item.name
} else if (this.createItem) {
link.itemName = this.newItem.name
} else if (this.selectedItemName) {
link.itemName = this.selectedItemName
}
link.itemName = this.currentItem.name
link.configuration = Object.assign({}, this.configuration)
if (this.currentProfileType) {
Expand Down

0 comments on commit 757cdde

Please sign in to comment.