widgets: fix widget register update from address 'auto' to something elese
This commit is contained in:
parent
3b0373f69d
commit
60ec29ecd7
2 changed files with 6 additions and 2 deletions
|
|
@ -152,7 +152,7 @@ class WidgetManager extends EventEmitter {
|
|||
newAddress = this.createAddressRef(widget),
|
||||
hash = widget.hash
|
||||
|
||||
if (address && address !== 'auto' && this.addressRoute[address].indexOf(hash) != -1) this.addressRoute[address].splice(this.addressRoute[address].indexOf(hash), 1)
|
||||
if (address && this.addressRoute[address].indexOf(hash) != -1) this.addressRoute[address].splice(this.addressRoute[address].indexOf(hash), 1)
|
||||
|
||||
if (!this.addressRoute[newAddress]) this.addressRoute[newAddress] = []
|
||||
this.addressRoute[newAddress].push(hash)
|
||||
|
|
|
|||
|
|
@ -840,9 +840,13 @@ class Widget extends EventEmitter {
|
|||
var data = {},
|
||||
oldData = {
|
||||
preArgs: propName == 'preArgs' ? oldPropValue : this.getProp('preArgs'),
|
||||
address: propName == 'address' ? oldPropValue : (this.getProp('address') === 'auto' ? '/' + this.getProp('id') : this.getProp('address'))
|
||||
address: propName == 'address' ? oldPropValue : this.getProp('address')
|
||||
}
|
||||
data[propName] = this.getProp(propName)
|
||||
|
||||
if (data.address === 'auto') data.address = '/' + this.getProp('id')
|
||||
if (oldData.address === 'auto') oldData.address = '/' + this.getProp('id')
|
||||
|
||||
widgetManager.registerWidget(this, data, oldData)
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue