mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-11-25 13:26:22 +03:00
fix: some debug))
This commit is contained in:
parent
59c3a41e4e
commit
6d78613653
3 changed files with 4 additions and 0 deletions
2
index.js
2
index.js
|
@ -31,6 +31,7 @@ io.on("connection", (socket) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("joinRoom", (room) => {
|
socket.on("joinRoom", (room) => {
|
||||||
|
console.log("joinRoom", room);
|
||||||
let rooms = Array.from(io.sockets.adapter.sids.get(socket.id));
|
let rooms = Array.from(io.sockets.adapter.sids.get(socket.id));
|
||||||
|
|
||||||
for (let room of rooms) {
|
for (let room of rooms) {
|
||||||
|
@ -51,6 +52,7 @@ io.on("connection", (socket) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("broadcastSync", ({ data, room }) => {
|
socket.on("broadcastSync", ({ data, room }) => {
|
||||||
|
console.log("broadcastSync", room);
|
||||||
socket.to(room).emit("broadcastSync", data);
|
socket.to(room).emit("broadcastSync", data);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,6 +17,7 @@ function onFooEvent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSync({ settings, Notes, NoteText, NoteName }) {
|
function onSync({ settings, Notes, NoteText, NoteName }) {
|
||||||
|
console.log(settings, Notes, NoteText, NoteName);
|
||||||
localStorage.setItem("Notes", Notes);
|
localStorage.setItem("Notes", Notes);
|
||||||
localStorage.setItem("NoteText", NoteText);
|
localStorage.setItem("NoteText", NoteText);
|
||||||
localStorage.setItem("NoteName", NoteName);
|
localStorage.setItem("NoteName", NoteName);
|
||||||
|
|
|
@ -71,6 +71,7 @@ function Settings() {
|
||||||
label={locals.BroadcastSync}
|
label={locals.BroadcastSync}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
|
console.log("Broadcasting sync");
|
||||||
socket.emit("joinRoom", settings.SyncPassword);
|
socket.emit("joinRoom", settings.SyncPassword);
|
||||||
} else {
|
} else {
|
||||||
socket.emit("leaveRoom");
|
socket.emit("leaveRoom");
|
||||||
|
|
Loading…
Add table
Reference in a new issue