diff --git a/openvidu-testapp/src/app/components/test-scenarios/test-scenarios.component.ts b/openvidu-testapp/src/app/components/test-scenarios/test-scenarios.component.ts index 6acd7116..ea45de5f 100644 --- a/openvidu-testapp/src/app/components/test-scenarios/test-scenarios.component.ts +++ b/openvidu-testapp/src/app/components/test-scenarios/test-scenarios.component.ts @@ -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;