Skip to content

Commit

Permalink
Merge pull request #4798 from gfodor/bug/session-id-leak
Browse files Browse the repository at this point in the history
Stop adding session id with every call to getMicrophonePresences
  • Loading branch information
johnshaughnessy authored Nov 3, 2021
2 parents 5ed0a1d + 91512d9 commit c425de2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/microphone-presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c425de2

Please sign in to comment.