openvidu-testapp: better end scenario logic

pull/845/head
pabloFuente 2024-09-19 13:37:46 +02:00
parent 888f0bdb7e
commit 5bacf37523
1 changed files with 6 additions and 3 deletions

View File

@ -103,9 +103,12 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
this.scenarioPlaying = true;
}
endScenario() {
for (const user of this.users) {
user.room.disconnect();
async endScenario() {
await Promise.all(this.users.map((user) => user.room.disconnect()));
try {
await this.roomApiService.deleteRoom(this.fixedRoomId);
} catch (error: any) {
console.error(JSON.stringify(error));
}
this.users = [];
this.scenarioPlaying = false;