Filter inactive participants from the dev tools

This commit is contained in:
Robert Long 2021-07-30 14:19:52 -07:00
parent e98abaff4d
commit c2d7156033
2 changed files with 15 additions and 3 deletions

View file

@ -167,9 +167,17 @@ export class ConferenceCallManager extends EventEmitter {
this.client.sendStateEvent(this.roomId, CONF_ROOM, { active: true }, "");
}
this.room
.getMembers()
.forEach((member) => this._processMember(member.userId));
const roomMemberIds = this.room.getMembers().map(({ userId }) => userId);
for (const userId of this.debugState.keys()) {
if (roomMemberIds.indexOf(userId) === -1) {
this.debugState.delete(userId);
}
}
roomMemberIds.forEach((userId) => {
this._processMember(userId);
});
for (const { call, onHangup, onReplaced } of this.pendingCalls) {
if (call.roomId !== roomId) {

View file

@ -41,6 +41,10 @@ export function DevTools({ manager }) {
};
}, [manager]);
if (!manager.joined) {
return <div className={styles.devTools} />;
}
return (
<div className={styles.devTools}>
{Array.from(debugState.entries()).map(([userId, props]) => (