From a24ec5a76f7cdf6a8ed7f66ee524d1843e60b7cf Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Fri, 9 Nov 2018 18:37:47 +0000
Subject: [PATCH] Just show people in room in VR count

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

diff --git a/src/hub.js b/src/hub.js
index 2fce4115d..9e01515f9 100644
--- a/src/hub.js
+++ b/src/hub.js
@@ -472,7 +472,8 @@ document.addEventListener("DOMContentLoaded", async () => {
 
   hubPhxPresence.onSync(() => {
     remountUI({ presences: hubPhxPresence.state });
-    const occupantCount = Object.entries(hubPhxPresence.state).length;
+    const occupantCount = Object.values(hubPhxPresence.state).filter(v => v.metas[0] && v.metas[0].presence === "room")
+      .length;
     vrHudPresenceCount.setAttribute("text", "value", occupantCount.toString());
 
     if (!isInitialSync) return;
-- 
GitLab