frontend: load room data in VideoRoomComponent only when necessary to avoid permissions error

This commit is contained in:
juancarmore 2025-07-08 23:53:07 +02:00
parent 424db94781
commit 0a028226f3

View File

@ -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.
*