hnininini
This commit is contained in:
parent
8cab4ac558
commit
50d46d0f0c
3 changed files with 59 additions and 33 deletions
|
|
@ -37,13 +37,13 @@ socket.on("message", async (response) => {
|
|||
}
|
||||
|
||||
const pixels = await getCanvas(room);
|
||||
|
||||
if (!pixels) {
|
||||
return;
|
||||
}
|
||||
|
||||
initCanvas(await getCurrentRoomConfig(), pixels);
|
||||
console.debug("Loaded canvas")
|
||||
|
||||
initCanvas(await getCurrentRoomConfig(), pixels);
|
||||
console.debug("Loaded canvas");
|
||||
});
|
||||
|
||||
socket.on("pixel-update", async (msg) => {
|
||||
|
|
@ -53,21 +53,25 @@ socket.on("pixel-update", async (msg) => {
|
|||
console.error("Got server error: " + msg.error.json.message);
|
||||
return;
|
||||
}
|
||||
|
||||
// console.debug("Here is msg.data")
|
||||
// console.debug(msg.result.data.json)
|
||||
const {
|
||||
roomSlug,
|
||||
// roomSlug,
|
||||
posX,
|
||||
posY,
|
||||
color
|
||||
} = msg.result.data.json
|
||||
color,
|
||||
} = msg.result.data.json;
|
||||
|
||||
const cfg = await getCurrentRoomConfig();
|
||||
|
||||
const cfg = await getCurrentRoomConfig()
|
||||
if (!cfg || !cfg.settings || !cfg.settings.roomColors) {
|
||||
console.error("Internal error: Cannot access config after retrieving it")
|
||||
console.debug(cfg)
|
||||
console.error(
|
||||
"Internal error: Cannot access config after retrieving it",
|
||||
);
|
||||
console.debug(cfg);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
renderCanvasUpdate(color, posX, posY);
|
||||
})
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue