Merge pull request #98 from amfl/websocket-fixes

Websocket node bugfixes
This commit is contained in:
Javi Agenjo
2020-04-15 10:51:00 +02:00
committed by GitHub

View File

@@ -86,10 +86,10 @@
this._ws.onmessage = function(e) {
that.boxcolor = "#AFA";
var data = JSON.parse(e.data);
if (data.room && data.room != this.properties.room) {
if (data.room && data.room != that.properties.room) {
return;
}
if (e.data.type == 1) {
if (data.type == 1) {
if (
data.data.object_class &&
LiteGraph[data.data.object_class]
@@ -105,7 +105,7 @@
that.triggerSlot(0, data.data);
}
} else {
that._last_received_data[e.data.channel || 0] = data.data;
that._last_received_data[data.channel || 0] = data.data;
}
};
this._ws.onerror = function(e) {