You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deletethis.users[userId];// Clean up users dictionary.
23
+
this.users.delete(userId);// Clean up users dictionary.
24
24
}
25
25
this.publish(this.sessionId,'updateDisplay');
26
26
}
27
+
adjustRoom(roomId,increment=1){
28
+
letcount=this.rooms.get(roomId)||0;
29
+
count+=increment;
30
+
this.rooms.set(roomId,count);
31
+
returncount;
32
+
}
27
33
join(userId){// Everyone enters through Lobby.
28
34
this.updateModel({userId});
29
35
}
@@ -42,15 +48,11 @@ class LobbyUI extends Croquet.View {
42
48
makeRoomButton.onclick=()=>this.enterRoom(newRoomName.value);// No need to make it, just enter.
43
49
}
44
50
updateDisplay(){
45
-
consttemplateContent=roomListTemplate.content,
46
-
rooms=this.model.rooms,
47
-
names=Object.keys(rooms).reverse();// Let's list the newest first.
51
+
consttemplateContent=roomListTemplate.content;
48
52
while(roomList.firstChild){// roomList.innerHTML = '' would not remove event handlers.
49
53
roomList.removeChild(roomList.firstChild);
50
54
}
51
-
for(letnameofnames){// TODO: keep this stable instead of flashing during changes. (Add or remove only as needed, and update concurrency.)
52
-
letconcurrency=rooms[name];
53
-
console.log(name,concurrency);
55
+
for(let[name,concurrency]ofthis.model.rooms){// TODO: keep this stable instead of flashing during changes. (Add or remove only as needed, and update concurrency.)
0 commit comments