Reset debugger state after leaving the room.

This commit is contained in:
Robert Long 2021-08-09 17:00:17 -07:00
parent d8c229d790
commit d6d3742864
2 changed files with 11 additions and 0 deletions

View file

@ -33,6 +33,7 @@ export class ConferenceCallDebugger extends EventEmitter {
this.manager.on("debugstate", this._onDebugStateChanged); this.manager.on("debugstate", this._onDebugStateChanged);
this.manager.client.on("event", this._onEvent); this.manager.client.on("event", this._onEvent);
this.manager.on("entered", this._onEntered); this.manager.on("entered", this._onEntered);
this.manager.on("left", this._onLeft);
} }
_onEntered = () => { _onEntered = () => {
@ -44,6 +45,15 @@ export class ConferenceCallDebugger extends EventEmitter {
} }
}; };
_onLeft = () => {
this.bufferedEvents = [];
this.debugState = {
users: new Map(),
calls: new Map(),
};
this.emit("debug");
};
_onEvent = (event) => { _onEvent = (event) => {
if (!this.manager.entered) { if (!this.manager.entered) {
this.bufferedEvents.push(event); this.bufferedEvents.push(event);

View file

@ -288,6 +288,7 @@ export class ConferenceCallManager extends EventEmitter {
clearTimeout(this._memberParticipantStateTimeout); clearTimeout(this._memberParticipantStateTimeout);
this.emit("participants_changed"); this.emit("participants_changed");
this.emit("left");
} }
logout() { logout() {