From c1e315eee199e133f797370339c6eba5504ed998 Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Fri, 9 Nov 2018 18:34:29 +0000
Subject: [PATCH] Wire up occupant count

---
 src/hub.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/hub.js b/src/hub.js
index bffa1d586..2fce4115d 100644
--- a/src/hub.js
+++ b/src/hub.js
@@ -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.
-- 
GitLab