Merge pull request #2794 from robin-k-wilson/fix-missing-data

add missing occupant data
This commit is contained in:
Robin K Wilson 2020-08-04 18:02:35 -07:00 коммит произвёл GitHub
Родитель 6f76a14132 1153b1baf8
Коммит 4c9f884208
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -142,9 +142,10 @@ export default class HubChannel extends EventTarget {
// This is fairly hacky, but gets the # of initial occupants
let initialOccupantCount = 0;
if (NAF.connection.adapter && NAF.connection.adapter.publisher) {
initialOccupantCount = NAF.connection.adapter.publisher.initialOccupants.length;
if (NAF.connection.adapter) {
// When I enter room as avatar, count number of people inside the room as avatars and lobby
// I enter room alone, no one in lobby, this is 0
initialOccupantCount = Object.keys(NAF.connection.adapter.occupants).length;
}
const entryTimingFlags = this.getEntryTimingFlags();