From 617d1f585eca3115130ed7fa5760508e6a09d917 Mon Sep 17 00:00:00 2001 From: Carlos Date: Sat, 3 Aug 2024 10:12:19 -0300 Subject: [PATCH] fix: disconnect from drawing room when the video is destroyed --- src/components/video/index.ts | 3 ++- src/services/{roomState => room-state}/index.test.ts | 0 src/services/{roomState => room-state}/index.ts | 1 + src/services/{roomState => room-state}/type.ts | 0 4 files changed, 3 insertions(+), 1 deletion(-) rename src/services/{roomState => room-state}/index.test.ts (100%) rename src/services/{roomState => room-state}/index.ts (99%) rename src/services/{roomState => room-state}/type.ts (100%) diff --git a/src/components/video/index.ts b/src/components/video/index.ts index 776663f4..63d68bba 100644 --- a/src/components/video/index.ts +++ b/src/components/video/index.ts @@ -22,7 +22,7 @@ import { Logger } from '../../common/utils'; import { BrowserService } from '../../services/browser'; import config from '../../services/config'; import { ConnectionService } from '../../services/connection-status'; -import { RoomStateService } from '../../services/roomState'; +import { RoomStateService } from '../../services/room-state'; import VideoConferenceManager from '../../services/video-conference-manager'; import { CamerasPosition, @@ -184,6 +184,7 @@ export class VideoConference extends BaseComponent { destroy(); this.roomState?.destroy(); + this.drawingRoom.disconnect(); this.kickParticipantsOnHostLeave = false; diff --git a/src/services/roomState/index.test.ts b/src/services/room-state/index.test.ts similarity index 100% rename from src/services/roomState/index.test.ts rename to src/services/room-state/index.test.ts diff --git a/src/services/roomState/index.ts b/src/services/room-state/index.ts similarity index 99% rename from src/services/roomState/index.ts rename to src/services/room-state/index.ts index ccc5fb60..5eb81a8b 100644 --- a/src/services/roomState/index.ts +++ b/src/services/room-state/index.ts @@ -407,6 +407,7 @@ export class RoomStateService { public destroy() { this.room.presence.off(PresenceEvents.LEAVE); this.room.presence.off(PresenceEvents.JOINED_ROOM); + this.drawingRoom.presence.off(PresenceEvents.UPDATE); this.room.off(RoomPropertiesEvents.UPDATE, this.updateLocalRoomState); } diff --git a/src/services/roomState/type.ts b/src/services/room-state/type.ts similarity index 100% rename from src/services/roomState/type.ts rename to src/services/room-state/type.ts