client sync: use raw target to avoid comparison errors

This commit is contained in:
bordun 2020-01-31 14:02:24 +01:00
parent ee77a7aa2c
commit 4a749c182c
3 changed files with 13 additions and 3 deletions

View file

@ -46,7 +46,7 @@ var Osc = class Osc extends EventEmitter {
let widgetTarget = widgets[i].getProp('target'),
match = true
if (data.target) {
if (data._rawTarget) {
// if the message target is provided (when message comes from another client connected to the same server)
// then we only update the widgets that have the exact same target
match = deepEqual(widgetTarget, data.target)

View file

@ -40,7 +40,7 @@ module.exports = {
ipc.send('sessionList', recentSessions, clientId)
ipc.send('serverTargets', settings.read('targets'), clientId)
},
sessionAddToHistory: function(data) {
@ -269,6 +269,9 @@ module.exports = {
data[k] = shortdata[k]
}
// only rawTarget will be used
delete data.target
data.args = data.preArgs ? data.preArgs.concat(value) : [value]
if (!data.noSync) ipc.send('receiveOsc', data, null, clientId)
@ -358,6 +361,9 @@ module.exports = {
}
}
// store raw target for client sync widget matching
cache._rawTarget = widgetData.target
},
removeWidget(data, clientId) {