mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-11-06 04:53:56 +03:00
fix: join to sync
This commit is contained in:
parent
6d78613653
commit
482031b1f6
3 changed files with 1 additions and 5 deletions
2
index.js
2
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);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -69,9 +69,8 @@ function Settings() {
|
|||
<SettingsSection name={locals.Sync}>
|
||||
<SettingsCheckBox
|
||||
label={locals.BroadcastSync}
|
||||
onChange={(e) => {
|
||||
onClick={(e) => {
|
||||
if (e.target.checked) {
|
||||
console.log("Broadcasting sync");
|
||||
socket.emit("joinRoom", settings.SyncPassword);
|
||||
} else {
|
||||
socket.emit("leaveRoom");
|
||||
|
|
Loading…
Reference in a new issue