oops quick bugfix

This commit is contained in:
not-nullptr 2024-03-22 15:12:34 +00:00
parent 8aaa779c44
commit 8c0e56b33a

View file

@ -68,7 +68,7 @@ export async function POST({ request, getClientAddress }) {
console.log("Room added:", JSON.stringify(room, null, 2)); console.log("Room added:", JSON.stringify(room, null, 2));
// push every room to the top which starts with `[SUYU OFFICIAL]` and was created with username "suyu" // push every room to the top which starts with `[SUYU OFFICIAL]` and was created with username "suyu"
const suyuRoom = RoomManager.rooms.find((r) => r.roomInfo.name.startsWith("[SUYU OFFICIAL]")); const suyuRoom = RoomManager.rooms.find((r) => r.roomInfo.name.startsWith("[SUYU OFFICIAL]"));
if (suyuRoom && user.username === "suyu") { if (suyuRoom && suyuRoom.host.username === "suyu") {
RoomManager.rooms.splice(RoomManager.rooms.indexOf(suyuRoom), 1); RoomManager.rooms.splice(RoomManager.rooms.indexOf(suyuRoom), 1);
RoomManager.rooms.unshift(suyuRoom); RoomManager.rooms.unshift(suyuRoom);
} }