From 482031b1f6102658afd12b2e15deeed583353eb9 Mon Sep 17 00:00:00 2001 From: Artemy Date: Wed, 5 Apr 2023 14:46:25 +0300 Subject: [PATCH] fix: join to sync --- index.js | 2 -- src/components/socket.js | 1 - src/pages/settings.jsx | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index 64c3e2a..9f1d85b 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,6 @@ io.on("connection", (socket) => { }); socket.on("joinRoom", (room) => { - console.log("joinRoom", room); let rooms = Array.from(io.sockets.adapter.sids.get(socket.id)); for (let room of rooms) { @@ -52,7 +51,6 @@ io.on("connection", (socket) => { }); socket.on("broadcastSync", ({ data, room }) => { - console.log("broadcastSync", room); socket.to(room).emit("broadcastSync", data); }); }); diff --git a/src/components/socket.js b/src/components/socket.js index 68cebf6..ce89f56 100644 --- a/src/components/socket.js +++ b/src/components/socket.js @@ -17,7 +17,6 @@ function onFooEvent() { } function onSync({ settings, Notes, NoteText, NoteName }) { - console.log(settings, Notes, NoteText, NoteName); localStorage.setItem("Notes", Notes); localStorage.setItem("NoteText", NoteText); localStorage.setItem("NoteName", NoteName); diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx index 4e40000..4f7a831 100644 --- a/src/pages/settings.jsx +++ b/src/pages/settings.jsx @@ -69,9 +69,8 @@ function Settings() { { + onClick={(e) => { if (e.target.checked) { - console.log("Broadcasting sync"); socket.emit("joinRoom", settings.SyncPassword); } else { socket.emit("leaveRoom");