frontend: load room data in VideoRoomComponent only when necessary to avoid permissions error
This commit is contained in:
parent
424db94781
commit
0a028226f3
@ -108,7 +108,6 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
|
|||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.roomId = this.roomService.getRoomId();
|
this.roomId = this.roomService.getRoomId();
|
||||||
this.roomSecret = this.roomService.getRoomSecret();
|
this.roomSecret = this.roomService.getRoomSecret();
|
||||||
this.room = await this.roomService.getRoom(this.roomId);
|
|
||||||
|
|
||||||
await this.checkForRecordings();
|
await this.checkForRecordings();
|
||||||
await this.initializeParticipantName();
|
await this.initializeParticipantName();
|
||||||
@ -177,15 +176,23 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async copyModeratorLink() {
|
async copyModeratorLink() {
|
||||||
|
await this.loadRoomIfAbsent();
|
||||||
this.clipboard.copy(this.room!.moderatorRoomUrl);
|
this.clipboard.copy(this.room!.moderatorRoomUrl);
|
||||||
this.notificationService.showSnackbar('Moderator link copied to clipboard');
|
this.notificationService.showSnackbar('Moderator link copied to clipboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
async copyPublisherLink() {
|
async copyPublisherLink() {
|
||||||
|
await this.loadRoomIfAbsent();
|
||||||
this.clipboard.copy(this.room!.publisherRoomUrl);
|
this.clipboard.copy(this.room!.publisherRoomUrl);
|
||||||
this.notificationService.showSnackbar('Publisher link copied to clipboard');
|
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.
|
* Checks if there are recordings in the room and updates the visibility of the recordings card.
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user