Skip to content
Snippets Groups Projects
Commit c1e315ee authored by Greg Fodor's avatar Greg Fodor
Browse files

Wire up occupant count

parent 5ec7c323
No related branches found
No related tags found
No related merge requests found
......@@ -468,9 +468,12 @@ document.addEventListener("DOMContentLoaded", async () => {
};
let isInitialSync = true;
const vrHudPresenceCount = document.querySelector("#hud-presence-count");
hubPhxPresence.onSync(() => {
remountUI({ presences: hubPhxPresence.state });
const occupantCount = Object.entries(hubPhxPresence.state).length;
vrHudPresenceCount.setAttribute("text", "value", occupantCount.toString());
if (!isInitialSync) return;
// Wire up join/leave event handlers after initial sync.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment