From cea0d79aab80fbf0d90eb1ad6550228f1a5c4616 Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Wed, 12 Aug 2026 22:42:50 +0000 Subject: [PATCH] fix(adhoc-public-samples-relay-js): 2 review findings in relay.js --- public/samples/relay.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/samples/relay.js b/public/samples/relay.js index 6b1f4f65f2..300ee8d9ae 100644 --- a/public/samples/relay.js +++ b/public/samples/relay.js @@ -19,9 +19,9 @@ var createMeshConnection = function (connectionId) { obj.websocket.onopen = function (e) { console.log('WebSocket Connected', e); }; obj.websocket.onmessage = function (e) { console.log('WebSocket Message', e); - if ((obj.state = 1) && (e.data == 'c')) { + if ((obj.state == 1) && (e.data == 'c')) { obj.state = 2; - if (obj.onStateChanged) { onStateChanged(obj, 2); } + if (obj.onStateChanged) { obj.onStateChanged(obj, 2); } console.log('WebSocket Peer Connection', e); obj.send('bob'); } else { @@ -31,7 +31,7 @@ var createMeshConnection = function (connectionId) { obj.websocket.onclose = function (e) { console.log('WebSocket Closed', e); obj.state = 0; - if (obj.onStateChanged) { onStateChanged(obj, 0); } + if (obj.onStateChanged) { obj.onStateChanged(obj, 0); } }; obj.websocket.onerror = function (e) { console.log('WebSocket Error', e); }; obj.state = 1; @@ -45,4 +45,4 @@ var createMeshConnection = function (connectionId) { }; return obj; -} \ No newline at end of file +}