join the channel of the room you want to subscribe on the server you just initialized a socket on
This commit is contained in:
parent
2b7b6b8684
commit
02ac670fe1
4 changed files with 81 additions and 35 deletions
|
|
@ -1,24 +1,17 @@
|
|||
import { initSocket, subscribe } from "../utils/streams";
|
||||
import { calculateLayout } from "./utils";
|
||||
import { authenticate } from "../utils/auth";
|
||||
import { fetchRoomConfig } from "../rooms";
|
||||
|
||||
// Initialize the layout
|
||||
calculateLayout();
|
||||
|
||||
async () => {
|
||||
// ? Not sure
|
||||
if (!(await authenticate())) {
|
||||
return;
|
||||
}
|
||||
await authenticate();
|
||||
|
||||
let room = window.location.pathname.split("/")[1];
|
||||
let room = window.location.pathname.split("/")[1];
|
||||
|
||||
if (room === "") {
|
||||
room = "epi-place";
|
||||
}
|
||||
if (!room) {
|
||||
room = "epi-place";
|
||||
}
|
||||
|
||||
initSocket();
|
||||
subscribe(room, "pixel-update");
|
||||
fetchRoomConfig(room);
|
||||
};
|
||||
await initSocket();
|
||||
await subscribe(room, "pixel-update");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue