From 5bacf375232a8e71b6bfc8ac763c4f9b27613882 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 19 Sep 2024 13:37:46 +0200 Subject: [PATCH] openvidu-testapp: better end scenario logic --- .../test-scenarios/test-scenarios.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 6acd7116b8..ea45de5fea 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;