Cleaning things up like always.

This commit is contained in:
Scott Idem
2024-10-07 15:29:20 -04:00
parent 2ac495af8e
commit ccb36ca953
5 changed files with 54 additions and 31 deletions

View File

@@ -78,6 +78,11 @@ function ws_connect_group_id({group_id, client_id}) {
let ws_recv_data = JSON.parse(event.data);
console.log(ws_recv_data);
if (client_id == ws_recv_data.client_id) {
console.log('WS: Message received was sent by self and is an echo that can be ignored.');
return false;
}
if (ws_recv_data.type == 'cmd') {
console.log(`WS: Type CMD: ${ws_recv_data.cmd}`);
ws_received_list_cmd.unshift(ws_recv_data); // Add to the beginning of the list