From 91512d97fe9fda6c4bfb399c3dd3010f10960b57 Mon Sep 17 00:00:00 2001 From: Greg Fodor Date: Mon, 1 Nov 2021 15:48:52 -0700 Subject: [PATCH] Stop adding session id with every call to getMicrophonePresences --- src/utils/microphone-presence.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/microphone-presence.js b/src/utils/microphone-presence.js index 4fcf36486c..23970a6d6c 100644 --- a/src/utils/microphone-presence.js +++ b/src/utils/microphone-presence.js @@ -22,7 +22,9 @@ export const getMicrophonePresences = (() => { if (playerInfo.isLocalPlayerInfo) { talking = sceneEl.systems["local-audio-analyser"].volume > MIC_PRESENCE_VOLUME_THRESHOLD; } - sessionIds.push(playerSessionId); + if (sessionIds.indexOf(playerSessionId) === -1) { + sessionIds.push(playerSessionId); + } currentSessionIds.push(playerSessionId); if (microphonePresences.has(playerSessionId)) { const presence = microphonePresences.get(playerSessionId);