mirror of https://github.com/OpenVidu/openvidu.git
ov-components: add null check for participant name updates in pre-join component and participant name directive
parent
2acf636842
commit
6137bdbbbc
|
@ -128,7 +128,7 @@ export class PreJoinComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
onParticipantNameChanged(name: string) {
|
||||
this.participantName = name;
|
||||
if (name) this.participantName = name;
|
||||
}
|
||||
|
||||
onEnterPressed() {
|
||||
|
@ -151,6 +151,7 @@ export class PreJoinComponent implements OnInit, OnDestroy {
|
|||
// this.cd.markForCheck();
|
||||
});
|
||||
this.libService.participantName$.subscribe((value: string) => {
|
||||
console.warn('participantName', value);
|
||||
if (value) this.participantName = value;
|
||||
// this.cd.markForCheck();
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { AfterViewInit, Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { CaptionsLangOption } from '../../models/caption.model';
|
||||
// import { CaptionService } from '../../services/caption/caption.service';
|
||||
import { OpenViduComponentsConfigService } from '../../services/config/directive-config.service';
|
||||
|
@ -490,7 +490,7 @@ export class LangOptionsDirective implements OnDestroy {
|
|||
@Directive({
|
||||
selector: 'ov-videoconference[participantName]'
|
||||
})
|
||||
export class ParticipantNameDirective implements OnInit {
|
||||
export class ParticipantNameDirective implements AfterViewInit, OnDestroy {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
|
@ -509,7 +509,7 @@ export class ParticipantNameDirective implements OnInit {
|
|||
/**
|
||||
* @ignore
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
ngAfterViewInit(): void {
|
||||
this.update(this.participantName);
|
||||
}
|
||||
|
||||
|
@ -531,7 +531,7 @@ export class ParticipantNameDirective implements OnInit {
|
|||
* @ignore
|
||||
*/
|
||||
update(value: string) {
|
||||
this.libService.setParticipantName(value);
|
||||
if (value) this.libService.setParticipantName(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue