diff --git a/firebase-network.js b/firebase-network.js index f857274b..301bb600 100644 --- a/firebase-network.js +++ b/firebase-network.js @@ -40,14 +40,14 @@ export async function getRoom(room) { return doc.data(); } -export async function listRooms() { +export async function listRooms(limit = 20, publicRoom = true) { const db = firebase.firestore(); const docs = await db .collection(COLLECTION) - .where('public', '==', true) + .where('public', '==', publicRoom) .orderBy('lastUpdateTime', 'desc') // TODO: limit to last 7 days instead. - .limit(20) + .limit(limit) .get(); const rooms = []; diff --git a/incrypt.html b/incrypt.html index da6a122f..9aaa0ee8 100644 --- a/incrypt.html +++ b/incrypt.html @@ -110,6 +110,7 @@
Private room
+ ++
+ {{ "Private room" }} with {{ privateRoom.players[0] }} + and {{ privateRoom.players.length }} others + ({{ moment(privateRoom.lastUpdateTime).fromNow() }}) +
+{{ openRoom.name }}, with {{ openRoom.players.join(', ') }} ({{ moment(openRoom.lastUpdateTime).fromNow() }})
- +