mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Fixed recording button toolbar
Checked role when the toolbar menu is opened for avoiding deprecated valuespull/739/head
parent
84bf80c24a
commit
91c328b58f
|
@ -1,4 +1,5 @@
|
||||||
import {
|
import {
|
||||||
|
AfterViewInit,
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
Component,
|
Component,
|
||||||
|
@ -100,7 +101,7 @@ import { TranslateService } from '../../services/translate/translate.service';
|
||||||
styleUrls: ['./toolbar.component.css'],
|
styleUrls: ['./toolbar.component.css'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class ToolbarComponent implements OnInit, OnDestroy {
|
export class ToolbarComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
/**
|
/**
|
||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
@ -399,6 +400,13 @@ export class ToolbarComponent implements OnInit, OnDestroy {
|
||||||
this.subscribeToRecordingStatus();
|
this.subscribeToRecordingStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
// Sometimes the connection is undefined so we have to check the role when the mat menu is opened
|
||||||
|
this.menuTrigger?.menuOpened.subscribe(() => {
|
||||||
|
this.isSessionCreator = this.participantService.getMyRole() === OpenViduRole.MODERATOR;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
if (this.panelTogglingSubscription) this.panelTogglingSubscription.unsubscribe();
|
if (this.panelTogglingSubscription) this.panelTogglingSubscription.unsubscribe();
|
||||||
if (this.chatMessagesSubscription) this.chatMessagesSubscription.unsubscribe();
|
if (this.chatMessagesSubscription) this.chatMessagesSubscription.unsubscribe();
|
||||||
|
|
Loading…
Reference in New Issue