From 0a028226f3634bf5c2665ca926e23a38e920930c Mon Sep 17 00:00:00 2001 From: juancarmore Date: Tue, 8 Jul 2025 23:53:07 +0200 Subject: [PATCH] frontend: load room data in VideoRoomComponent only when necessary to avoid permissions error --- .../src/lib/pages/video-room/video-room.component.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/projects/shared-meet-components/src/lib/pages/video-room/video-room.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/video-room/video-room.component.ts index db8145d..3d061f0 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/video-room/video-room.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/video-room/video-room.component.ts @@ -108,7 +108,6 @@ export class VideoRoomComponent implements OnInit, OnDestroy { async ngOnInit() { this.roomId = this.roomService.getRoomId(); this.roomSecret = this.roomService.getRoomSecret(); - this.room = await this.roomService.getRoom(this.roomId); await this.checkForRecordings(); await this.initializeParticipantName(); @@ -177,15 +176,23 @@ export class VideoRoomComponent implements OnInit, OnDestroy { } async copyModeratorLink() { + await this.loadRoomIfAbsent(); this.clipboard.copy(this.room!.moderatorRoomUrl); this.notificationService.showSnackbar('Moderator link copied to clipboard'); } async copyPublisherLink() { + await this.loadRoomIfAbsent(); this.clipboard.copy(this.room!.publisherRoomUrl); this.notificationService.showSnackbar('Publisher link copied to clipboard'); } + private async loadRoomIfAbsent() { + if (!this.room) { + this.room = await this.roomService.getRoom(this.roomId); + } + } + /** * Checks if there are recordings in the room and updates the visibility of the recordings card. *