widgets: osc: allow changing server-side cached osc props without sending all of them
This commit is contained in:
parent
7249545d36
commit
f50ef3521a
2 changed files with 13 additions and 14 deletions
|
|
@ -224,7 +224,10 @@ module.exports = {
|
|||
widgetHashTable[clientId] = {}
|
||||
}
|
||||
|
||||
widgetHashTable[clientId][data.hash] = data.data
|
||||
for (var k in data.data) {
|
||||
widgetHashTable[clientId][data.hash][k] = data.data[k]
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
removeWidget(data, clientId) {
|
||||
|
|
|
|||
|
|
@ -21,17 +21,7 @@ var WidgetManager = class WidgetManager extends EventEmitter {
|
|||
|
||||
ipc.on('reconnect', ()=>{
|
||||
for (var hash in this.widgets) {
|
||||
ipc.send('addWidget', {
|
||||
hash:hash,
|
||||
data:{
|
||||
precision: this.widgets[hash].getProp('precision'),
|
||||
preArgs: this.widgets[hash].getProp('preArgs'),
|
||||
split: this.widgets[hash].split,
|
||||
target: this.widgets[hash].getProp('target'),
|
||||
address: this.widgets[hash].getProp('address'),
|
||||
noSync: this.widgets[hash].getProp('noSync'),
|
||||
}
|
||||
})
|
||||
this.registerWidget(this.widget[hash])
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -105,9 +95,15 @@ var WidgetManager = class WidgetManager extends EventEmitter {
|
|||
this.scrollingWidgets.push(hash)
|
||||
}
|
||||
|
||||
this.registerWidget(widget)
|
||||
|
||||
}
|
||||
|
||||
registerWidget(widget, data) {
|
||||
|
||||
ipc.send('addWidget', {
|
||||
hash:hash,
|
||||
data:{
|
||||
hash: widget.hash,
|
||||
data: data || {
|
||||
precision: widget.getProp('precision'),
|
||||
preArgs: widget.getProp('preArgs'),
|
||||
split: widget.split,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue