switchers: only write data if the current state is valid (fix in case therere are multiple switchers synced with different possible values)

This commit is contained in:
jean-emmanuel 2017-01-03 13:04:31 +01:00
parent 5fcb9b6d39
commit 01022d1631

View file

@ -22,7 +22,7 @@ module.exports = class _switchers_base extends _widgets_base {
var {id, widget, linkId, fromExternal, options} = e
if (this.value._selected !== false && widget.abstract._isSwitcher !== true && this.isWatching(id, widget)) {
if (this.value._selected !== false && this.value[this.value._selected] && widget.abstract._isSwitcher !== true && this.isWatching(id, widget)) {
this.value[this.value._selected][id] = JSON.parse(JSON.stringify(widget.abstract.getValue()))