Code: Select all
function populateRoomsList() {
let roomsRaw = sfs.roomManager.getRoomListFromGroup("group_1");
let roomList = [];
console.log(roomsRaw)
for (let r in roomsRaw) {
let room = roomsRaw[r];
roomList.push(`
<a href="#" onclick="onRoomSelected({ id: ${room._id}, name: '${room.name.toString()}' })" id="room" class="list-group-item list-group-item-action">${room.name} <p class='itemSub'>Users: ${room._userCount}/${room.maxUsers}</p></a>`);
}
$("#list-group").empty()
$("#list-group").append(roomList.join(','))
}I have two rooms with the group ID "group_1", but when I call the function `getRoomListFromGroup("group_1")`, it doesn't work. However, it works with the default. I don't understand why. Here is the code on the client side.