From 0b9c15decb8c94fd86da4143e624800926e2863c Mon Sep 17 00:00:00 2001 From: louisa Date: Wed, 14 Jun 2023 22:26:00 +0200 Subject: [PATCH] help --- app.js | 17 +++++++++-------- public/index.html | 1 - 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index eab5ec3..053baba 100644 --- a/app.js +++ b/app.js @@ -35,15 +35,16 @@ var io = require('socket.io')(server); socket.on("blink", () => { console.log("Blink event received!"); + io.emit("blink"); }); - - socket.on("message", (message) => { - console.log("Received message:", message); - if (message === "blink") { - console.log("Blink event received!"); - io.emit("blink"); // Trigger the blink event to all connected clients - } - }); + + // socket.on("message", (message) => { + // console.log("Received message:", message); + // if (message === "blink") { + // console.log("Blink event received!"); + // io.emit("blink"); // Trigger the blink event to all connected clients + // } + // }); socket.on('chat message', (msg) => { console.log('[user]['+ socket.id + '][' + msg + ']'); diff --git a/public/index.html b/public/index.html index 5e51265..7c4eb7f 100644 --- a/public/index.html +++ b/public/index.html @@ -38,7 +38,6 @@ const message = inputField.value; if (message === 'BLINK') { - socket.emit('blink', message); socket.emit('blink'); console.log('socket: blink'); }