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; this.scenarioPlaying = true;
} }
endScenario() { async endScenario() {
for (const user of this.users) { await Promise.all(this.users.map((user) => user.room.disconnect()));
user.room.disconnect(); try {
await this.roomApiService.deleteRoom(this.fixedRoomId);
} catch (error: any) {
console.error(JSON.stringify(error));
} }
this.users = []; this.users = [];
this.scenarioPlaying = false; this.scenarioPlaying = false;